Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the primary purpose of a priority queue?
Think about how tasks are executed based on urgency.
What is a heap?
Consider how heaps are structured compared to other trees.
Which operation removes the highest priority element from a heap?
Remember the operation that focuses on removing elements.
True or False: The max heap property requires each parent to be less than its children.
Think about how parents compare to their children in a binary tree.
Given the following values, insert them into an empty max heap: 10, 20, 15, 30, 5. Show the steps taken.
Keep track of the parent comparisons during each insertion.
Construct a min heap from the following elements: 5, 3, 17, 10, 84, 19, 6, 22, 9. Show how to maintain the min heap property.
Remember, each insertion can cause a bubble down to find the correct position.
5 more questions in this section. Enroll free to practise them all.
Enroll free