Suppose you have k sorted arrays each with n elements and you want to combine them into
Fantastic news! We've Found the answer you've been seeking!
Question:
Suppose you have k sorted arrays each with n elements and you want to combine them into a single sorted array of k*n elements. (A k-way merge operation)
a. Using the merge procedure disconnected, merge the first two arrays, then merge in third, then merge in fourth, and so on. What is the time complexity in terms of k and n?
b. Give a more efficient solution to this problem using divide-and-conquer.
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date: