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 the time complexity of insert operations in heaps?
Think about what governs the height of the tree.
Where is the maximum element found in a max-heap?
Is it at the top or somewhere deeper in the tree?
What is the time complexity of inserting into a heap?
Consider how many levels we might have in a tree with N elements.
True or False? The maximum value in a max-heap can be found at any leaf node.
Recall the definition of a max-heap.
Given an initial heap [50, 30, 20, 10], how would the heap look after inserting 40? Show the intermediate steps.
Consider how to keep the parent node greater than its children.
If you start with a heap of [45, 30, 20, 10] and perform a delete max operation, what will the sequence of heaps look like? Describe each removal step.
Focus on restoring the heap property after each deletion.
5 more questions in this section. Enroll free to practise them all.
Enroll free