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.
Define what a max heap is.
Think about the order of elements in a tree.
What operation is performed to maintain heap order when inserting a new element?
Consider how you would move an element upwards in the heap.
In a max heap, where is the maximum element located?
If you think about the structure of heaps, where does the largest value naturally position itself?
The time complexity of inserting an element into a heap is?
Consider the height of the structure you're dealing with.
Construct a max heap from the list [5, 2, 9, 1, 6, 8, 3]. Detail each step.
Start from the last non-leaf node and work your way up to build a proper structure.
Explain why bottom-up heapification is more efficient than inserting elements one by one.
Which process reduces the number of required swaps?
4 more questions in this section. Enroll free to practise them all.
Enroll free