Merge K Sorted Linked Lists, six ways

Try:
CALL
1 / 1

Code

The highlighted line runs next. The pill shows the live values in the running call.

Cost

Work done so far, and how the six solutions compare

The lists

Colour = the list a node came from

Keyboard: ← → step, Space play or pause. Up to 5 lists, 4 sorted values each, 12 nodes in total. Solutions 2–6 relink the existing nodes; brute force builds new ones. When values tie, solutions may emit equal nodes in a different order (the heap especially), but the resulting values are identical.