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 the maximum value of a max-heap?
Look at the root of the tree.
Describe how to insert a new value into a heap.
What position do we fill when adding a new node?
What property must a max-heap satisfy?
Think about the definition of max-heap.
True or False: Insertion in a heap can violate the max-heap property.
What happens when we add a value larger than its parent?
Given a max-heap of [30, 20, 25], insert 15 and demonstrate the steps required to maintain the heap property.
Where does 15 go, and does it change anything?
Starting with the heap [50, 30, 25, 20, 15], delete the root and show the new state of the heap after replacement and sifting down.
Ensure to visualize each change step.
5 more questions in this section. Enroll free to practise them all.
Enroll free