RK DSA Studio

Heaps & priority queues

A heap is a complete binary tree with parent-child priority ordering. A priority queue uses this to access an extreme item quickly.

Remember: Priority lives at the root.

Example: A min-heap containing 7,2,5 has root 2.

The interactive workspace loads here when JavaScript is available. You can still browse the learning notes and links above without it.