Quant Memo
Coding/●●●●

Merge k sorted linked lists

Asked at HRT, Citadel

You are given k sorted singly linked lists (each ordered ascending). Splice them into one sorted linked list and return its head.

1 -> 4 -> 5
1 -> 3 -> 4      ->   1 -> 1 -> 2 -> 3 -> 4 -> 4 -> 5 -> 6
2 -> 6

Target O(Nlogk)O(N \log k) total time for NN nodes, and O(k)O(k) extra memory.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions