Question: consider the following variant of mergesort instead of dividing the...
Consider the following variant of Mergesort. Instead of dividing the input list into two (roughly) equal sized lists, we divide them into three equal sized lists (assume for convenience that n = 3k for some integer k).
Given three ordered lists A, B, C, procedure merge(A,B,C) creates a single ordered lists from these three.
3a. Show how to Merge (not mergesort) three ordered lists each of size n/3, with a total of at most n*(5/3) compares.
The Mergesort algorithm is now
If n = 1 then return A.
Else divide A into three equal sized lists B, C, D.B = mergesort(B, n/3);
C = mergesort(C, n/3);
D = mergesort(D, n/3);
3b. Let T(n) denote the number of comparisons done by this algorithm given a list of size n. Write a recurrence relation for T(n) and then find its closed form solution.
3c. In terms of O, Θ, Ω how does the bound on T (n) from part b) relate to the worst case number of compares done by the original mergesort?