Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
Define a heap in your own words.
Think about what makes heaps different from other data structures.
What is the time complexity of inserting an element into a heap?
Recall how height affects performance.
What property must a max-heap satisfy?
Think about the requirements for retrieving the maximum element quickly.
True or False: A binary tree can be a heap even if it has missing nodes.
Recall the shape property of heaps.
Create a valid max-heap from the following numbers: 10, 20, 15, 30, 25. Describe how you would go about it.
Keep an eye on the relationships between the parent and child nodes.
A max-heap is given as [50, 30, 20, 15, 10]. If we insert a value of 25, how does this affect the heap?
Think about how the insertion balances the structure.
4 more questions in this section. Enroll free to practise them all.
Enroll free