- #1
kekido
- 20
- 0
Homework Statement
There are k sorted lists, each of which has n elements. Provide a divide and conquer algorithm that merges these lists into a single list.
Homework Equations
N/A
The Attempt at a Solution
If a sequential algorithm is used, the time is proportional to the length of the resulting list.
So if we merge the first two, then merge the result with the third, and so on, we get this:
2n+3n+...+kn, which is in the order of n*k^2
However, I can't find any merging algorithm that uses divide and conquer. In standard mergeSort algorithm, the merging part is also a sequential read/compare, so it takes linear time. I'm wondering if there exists a Divide and conquer algorithm for merging sorted lists?