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.
What is a heap?
Think about how trees can have children and parent nodes.
What is the time complexity for insertion in a heap?
Consider how many levels the tree has.
What is the time complexity for deleting an element from a heap?
Think about how levels of a tree work.
True or False: Increasing a value in a min-heap may require moving the updated value downwards.
How does value comparison work in heaps?
Given the following input values: 15, 10, 20, 30, 5, illustrate how to perform heap operations to maintain a min-heap.
Start with the first value as the root.
Implement a step-by-step demonstration of Dijkstra's algorithm using the following graph: A (0) -> B (4), A (0) -> C (2), B (4) -> D (5), C (2) -> D (8) and show how the heap is updated.
Keep track of reported distances in a table as you iterate over vertices.
4 more questions in this section. Enroll free to practise them all.
Enroll free