1. Engineering
  2. Computer Science
  3. 3 consider the following variant of mergesort instead of dividing...

Question: 3 consider the following variant of mergesort instead of dividing...

Question details

3. 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). gle ordered lists from these three. n/3, with a total of at most jn compares Given three ordered lists A, B, C, procedure merge(A,B,C) creates a sin 3a. Show how to Merge (not mergesort) three ordered lists each of size The Mergesort algorithm is now Procedure mergesort (A,n);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 = merge sort(D,n/3); return merge(B,C,D); end 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?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution