Question: Consider a modified version of Mergesort algorithm, which works as follows. if the array has less than 3 elements, then we sort it trivially otherwise,

Consider a modified version of Mergesort algorithm, which works as follows.
if the array has less than 3 elements, then we sort it trivially
otherwise, we
recursively sort the first third of the array
recursively sort the second third of the array
recursively sort the final third of the array
merge the first third with the second third
merge the first two-third with the final third
return thefnal merged array
Which of these best captures the recurrence for the running time of the above algorithm? You may ignore floors and ceilings or assume that the size of array is a power of 3.
T(n)=3T(n3)+n
T(n)=2T(n2)+n
T(n)=3T(n2)+n
T(n)+3T(n3)+n2
 Consider a modified version of Mergesort algorithm, which works as follows.

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!