Question: Suppose you are given a new hardware device that can merge k> 2 different sorted lists of total size n into a single sorted list

Suppose you are given a new hardware device that can merge k> 2 different sorted lists of total size n into a single sorted list in O(n) time, independent of the value of k. Such a device could, for example, be based on a hardware streaming system or could be based on a network protocol. Show that you can use this device to sort items efficiently by answering the following. Suppose that you are given k sorted lists where list i has length ni with m= Zni. Design and analyze an efficient algorithm to sort the m items using the hardware device, i.e., your algorithm uses the hardware device as a method call mergeKlists(L[][], k, m) to sort the m items, where L is a k X m two-dimensional array containing a total of m items and L[i] contains a sorted list of length ni. Function merge Klists(...) returns a 1-d sorted array of length m. What is the input size of this problem? What is the output-size of this problem? What are the time and space complexities of your algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
