⚡ Priority Queue Operations
USACO C++ Book · Interactive Visualizer
⛰️ Priority Queue — Max-Heap & Min-Heap Operations
Max-Heap
Min-Heap
Step 0/10
📊 Heap Structure (complete binary tree, parent ≥/≤ children)
🗂 Heap State
Current Mode
Top Element (top)
Underlying Array (level-order)
push/pop:
O(log N)
top:
O(1)
💻 Code
Hint
Click
Next Step ▶
to start and observe how push/pop maintain the heap property in max-heap and min-heap.
◀ Prev
Next Step ▶
↺ Reset
0/10
Keyboard:
→
Next
←
Prev
R
Reset