Algorithms Homework 1a: Foundations (Analysis)

37 阅读1分钟

Download link:# Algorithms Homework 1a: Foundations (Analysis)

Description

Rate this product

Problem 1 Asymptotic Analysis30 points
1. Prove the following statements:
m−1xi(10pts)
(i) For any 0 < x < 1, ex =+ Θ(xm), for all m = 1, 2, · · · .
i!

i=0

  1. Solve the following problems in CLRS.
  • (a)Problems 3.1(a,b,c) (Page 71 in 4th edition).(9pts)
    (b)Problems 4.1(g) (Page 119 in 4th edition) and 4.4(j) (Page 121 in 4th edition) using
    recursion trees method, and use Master’s theorem to verify your result. State your base
    case clearly and articulate your solution.(6pts)
  1. Problems 4.1(h) (Page 119 in 4th edition) and 4.4(h) (Page 121 in 4th edition) using substitution method. State your base case clearly and articulate your solution. (5pts)

In the class, we studied different kinds of algorithms. This problem is about the theoretical analysis of the algorithms presented in the class and their validation using simulation experiments.

  1. Compute the average running time of Insertion Sort, Merge Sort and the maximum element

algorithms formally. (10pts)

  1. Implement Insertion Sort, Merge Sort and the maximum element algorithms in Python, val-idate their correctness and simulate their average run-time performance empirically, for dif-

ferent input sizes. (10pts)

(Hint: Random inputs can be generated using random.sample() function.)