Question: Algorithm design and analysis class Problem 2 ( 9 points ) Insertion sort can be expressed as a recursive procedure. To sort A [ 1

Algorithm design and analysis class
Problem 2(9 points)
Insertion sort can be expressed as a recursive procedure. To sort A[1dotsn], we recursively sort A[1dotsn-1] and then insert A[n] into the sorted array A[1dotsn-1]. Write a recurrence for the running time of this recursive version of insertion sort.
Problem 3(30 points) For parts (a)-(e), decide if it is true or false. If the statement is true, then prove it (to prove it you will either need to use the definition and find constants or use the limit laws). If the statement is false, then give a reason or a counterexample. Then answer part (f).
8n3=O(n4).
n3in(n4)
2ninO(2n+1)
n!in((n+1)!)
What does O(1) mean?
What does (1) mean?
Problem 4(21 points)
Let f(n) and g(n) be asymptotically positive functions. Prove or disprove each of the following conjectures.
a.f(n)=O(g(n)) implies g(n)=O(f(n))
b.f(n)+g(n)=(max(f(n),g(n)))
c.g(n)=(f(n)) implies f(n)=O(g(n)).
 Algorithm design and analysis class Problem 2(9 points) Insertion sort can

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!