Skip to main content

Heaps & Priority Queues Quiz

Editorial

16 questions across the four Heaps & Priority Queues lessons and the section's problems: pushing and popping a heap, the k best, merging and greedy choices, and two heaps for a median. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.

If one trips you up, its lesson is Introduction to Heaps, Top K and the Kth Element, Merging and Scheduling with a Heap or Two Heaps: the Running Median.

Quiz

1 / 16

Multiple choice

You push 6, 2, 9, 1 and 5, in that order, into an empty min-heap. What is its array afterwards?