Merge k Sorted Lists · Compound Engineer

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).

DSAProHardStep-through playerBy Aayush OstwalSolve on LeetCode ↗
Spotted a mistake in this lesson?Report an issue →