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