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 a heap?
Think about a tree structure used to prioritize elements.
What does the max heap property require?
Consider how numbers compare between parent and child.
What is a core property of a heap?
Recall the definitions and properties we covered.
True or False: The structure of a heap allows for any node position to be filled randomly.
Think about how we discussed constructing the heap.
Given a series of integers, insert them one by one into a max heap and show the steps taken after each insertion to maintain the heap property.
Make sure to check against parents after each insertion!
The following structures show trees. Determine if they are heaps and explain why or why not.
Mark the violations if found!
5 more questions in this section. Enroll free to practise them all.
Enroll free