Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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. (3.a) Suppose that you are given k sorted lists where list i has length ni with m= S ni. 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 twodimensional array containing a total of m items and L[i] contains a sorted list of length ni. Function mergeKlists() 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? (3.b) Suppose now that you are given a list of n items (unordered). Show that you can use the hardware device to sort n elements in O(n log n / log k) time. Notice that, if k is (n), then you can use this device to sort in linear time. Obviously, your algorithm will use method calls mergeKlists() judiciously. 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

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 Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

When should an Internal Service Fund be used?

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago