Question: In mergesort algorithm we separate T[1...n] into two half size arrays. Consider the following algorithm. Let n be power of 3 (n = 3^k). Separate
In mergesort algorithm we separate T[1...n] into two half size arrays. Consider the following algorithm. Let n be power of 3 (n = 3^k). Separate n to three arrays of size n/3, (n+1)/3, (n+2)/3. Sort each of these recursively and then merge the three sorted arrays. Call this algorithm Tri_Mergesort. a. What is the recurrence equation? b. Solve the recurrence equation and find the running time of this algorithm. c. is Tri_Mergesort algorithm better than the mergesort we considered in class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
