Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer the following question (10 marks) You decided to modify mergesort by recursively splitting an array of size n into k sorted subarrays, k

Please answer the following question

image text in transcribed

(10 marks) You decided to modify mergesort by recursively splitting an array of size n into k sorted subarrays, k ? 2, and merging these subarrays. Time for merging is c(k-1)n where c is a constant factor, because at each step the largest item among the k top ones in the k subarrays is found by k - 1 comparisons and placed into the merged array. Specify the recurrence relation and derive the closed-form formula for sorting time T*(n) of the modified mergesort for an arbitrary k (you should show all steps of the derivation) Then determine whether the modified mergesort could be faster for some k ? 2 than the conventional one (k-2) with the sorting time T2(n) cn log2 n. Hint: To have a well-defined recurrence, assume that n - k"m with the integer m -log n and T(1) -0. You might need also the equality log2x -log2 k logk x for all x > 0 and the inequality k > 1 + log2 k for all k > 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago