Question: Sam Smartypants likes how splitting the problem up into halves in merge sort reduces the sorting problem from O(n^2 ) to O(n lg n). He

Sam Smartypants likes how splitting the problem up into halves in merge sort reduces the sorting problem from O(n^2 ) to O(n lg n). He decides that splitting the array into thirds will make things even better. That is, he decides to make a recursive call on each third of the array and then merge them.

(a) Assuming that n is a power of three, that T(1) = 1, and that the running time of the merge step is exactly n, give a recurrence for the running time of Sams algorithm. (b) Find the solution to the recurrence in big-Oh notation and prove it using the substitution method.

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!