Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a heap?
Think about the parent-child relationship.
How do we restore the heap property when increasing a value?
Consider how values move in relation to their parent.
What happens when a value in the heap is increased?
Think about how increasing a value affects its position.
True or False: Dual arrays are used to keep track of vertex indices in heaps.
Consider the purpose of having two mapping arrays.
You have a max-heap with the values [50, 30, 20, 15, 10, 8, 5]. If you insert 40 and then decrease it to 25, describe the steps taken to maintain the heap property.
Focus on both insertion and value modification through bubbling.
Write a complete algorithm to handle a value increase in a min-heap, including handling swaps up the tree.
Consider all the conditions where swaps will need to happen.
6 more questions in this section. Enroll free to practise them all.
Enroll free