← Heaps & Priority Queues Quiz: all 8 questions
Heaps & Priority Queues Quiz · Question 6 of 8
Merging k sorted lists with N total nodes using a heap of list heads takes…
Merging k sorted lists with N total nodes using a heap of list heads takes…
- A.O(N·k)
- B.O(N log k)
- C.O(N log N)
- D.O(k)
Answer & explanation
Correct answer: O(N log k)
The heap never holds more than k nodes, and each of the N nodes is pushed and popped once.
Can you get the rest right without peeking?
Take the timed Heaps & Priority Queues Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →