🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Heaps & Priority Queues Quiz: questions with answers

8 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What are the costs of a binary heap's operations? (select all that apply)
  2. Q2. To find the k-th LARGEST element in O(n log k), you keep…
  3. Q3. What does this print? (code)
  4. Q4. How do you get max-heap behaviour with Python's heapq?
  5. Q5. In Java, how do you create a max-heap of integers?
  6. Q6. Merging k sorted lists with N total nodes using a heap of list heads takes…
  7. Q7. For the running median (Find Median from Data Stream), which structure is standard?
  8. Q8. Which questions are good fits for a heap? (select all that apply)