The general merge algorithm has a set of pointers p0..n that point to positions in a set of lists L0..n. Initially they point to the first item in each list. The algorithm is as follows:
While any of p0..n still point to data inside of L0..n instead of past the end:
1) do something with the data items p0..n point to in their respective lists
2) find out which of those pointers points to the item with the lowest key; advance one of those pointers to the next item in its list