A K-Way Merge Algorithm
An array of k index values corresponding to the current element in each of the k lists, respectively.
Main loop of the K-Way Merge algorithm:
Find the index of the minimum current item, minItem
Process minItem(output it to the output list)
For i=0 until i=k-1 (in increments of 1)
- If the current item of list i is equal to minItem then advance list i.
Go back to the first step.