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 max-heap?
Think about the root node in a max-heap.
What is the time complexity of inserting an element in a heap?
Consider the height of the heap.
What is the time complexity of both insertion and deletion in a max-heap?
Think about the height of a binary tree as you determine time complexity.
A min-heap requires that every parent node be larger than its children.
Consider the definition of a min-heap.
Explain how the time complexity of the heapifying process leads to an overall O(N) time complexity when constructing a heap from an unordered array.
Focus on how node counts decrease while fixing the heap properties.
Take an array of numbers and transform it into a max-heap. Outline each step you take in the process.
Recall the definition of a max-heap while performing swaps.
6 more questions in this section. Enroll free to practise them all.
Enroll free