Question: Exercise 5 . Variations on MergeSort a ) We want to try a variation on MergeSort called MergeSort 3 , with splits up the input
Exercise Variations on MergeSort
a We want to try a variation on MergeSort called MergeSort with splits up the input array into subarrays of length or close to it makes recursive calls to sort them, and then does a way merge from Homework
Write the recurrence equation for MergeSort and show a call tree for it Obtain a solution for this recurrence equation, using your favorite method.
b Generalize your work above to MergeSortK, which splits up the array into subarrays of length where Note that when we get regular MergeSort and when we get MergeSort
c We now have a variation on MergeSort called SillySort which splits up the input array into subarrays of length rather than During the Merge, any duplicate elements are removed. Write the recurrence equation for MergeSort and show a call tree for it Obtain a solution for this recurrence equation, using your favorite method.
d Generalize your work above to SillySortK, which uses subarrays of length rather than where Note that when we get regular MergeSort and when we get SillySort
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
