Merge k Sorted Lists
Merge k sorted linked lists into one sorted list. Why the next node of the answer is always one of the k list heads, and how a min-heap picks it in O(log k).
Spotted a mistake in this lesson?Report an issue →
Merge k sorted linked lists into one sorted list. Why the next node of the answer is always one of the k list heads, and how a min-heap picks it in O(log k).