Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the shape property of a heap?
Think about how a tree's structure is defined.
In a max heap, which is greater, a parent or its children?
Consider how 'max' is defined in 'max heap'.
Which operation retrieves the highest priority element in a max heap?
Think about which operation relates to removing the top element.
True or False: Every child in a max heap must be smaller than its parent.
Reflect on the definition of a max heap.
Given a sequence of numbers, insert them into a max heap one by one. Start with [10, 20, 30]. What does the heap look like after all insertions?
Remember how to maintain the max heap property with each insertion.
Construct a heap from the following set of values: 15, 10, 20, 8, 30, 25. Show the tree structure.
Think about how to position values to maintain both the shape and value properties.
5 more questions in this section. Enroll free to practise them all.
Enroll free