Question Bank

Heap and Priority Queue Quiz

Difficulty: Medium

Multi-step prompts on binary heaps: sift-up vs sift-down, heapify cost, top-K extraction, and the array layout that makes parent/child arithmetic O(1).

Question Bank
/

Heap and Priority Queue Quiz

Heap and Priority Queue Quiz

Multi-step prompts on binary heaps: sift-up vs sift-down, heapify cost, top-K extraction, and the array layout that makes parent/child arithmetic O(1).

Question Bank
Medium
JavaScript
Python
5 questions
heap
priority-queue
data-structures
interview-prep

213 views

1

Insert the keys 5, 3, 8, 1, 9, 2 into an initially empty min-heap by push-ing one at a time. What is the resulting array layout (1-indexed by level), and which sift direction is each insert?