Which array is a min-heap?
Warm-up · Multiple choice · about 3 min
Each option is an array. Index 0 is the root, indices 1 and 2 are its children, and so on. Pick the array that is a valid min-heap.
Learn the idea first: Binary heaps: array layout, sift up, sift down, a visual lesson.
More Binary heaps: array layout, sift up, sift down problems
- Parent and child indices Warm-up
- Insert into a heap Warm-up
- Is this array a min-heap? Warm-up
- Extract the minimum Standard
- Implement push and pop Standard
- Spot the bug: sift down Standard
- Implement a max-heap with decrease-key Challenge