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 main property of a max heap?
Consider the relationship between parents and children.
How can you determine the children of a node at index 2 in an array representation of a heap?
Use the formulas: left child index = 2i + 1 and right child index = 2i + 2.
What is the time complexity of inserting an element in a max heap?
Recall how insertion works in relation to the height of a tree.
True or False: In a min heap, the highest value is always at the root.
Think about the properties of heaps.
Given the array [12, 7, 5, 29, 38, 3], create a max heap and explain your process.
Map out each path as you fix the heap.
Consider an application using priority queues in scheduling tasks. Discuss how a heap could help manage this effectively.
Think about the properties of priorities in daily tasks.
6 more questions in this section. Enroll free to practise them all.
Enroll free