Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started