Algomination
Data Structures
AboutContact

Algomination

Learn algorithms and data structures through smooth, interactive visualizations.

SortingSearchingArray AlgorithmsData StructuresAboutContact

© 2026Algomination. Created by Omang Rawat & Rahul Soni.

Omang Rawat
Rahul Soni
All data structures

Priority Queue (Heap)

Push/Pop O(log n)Space O(n)

A binary heap that always serves the highest-priority element first. Insert sifts up and extract sifts down in O(log n); peek is O(1). Switch between a min-heap and a max-heap.

Type:
1
7
3
12
9
5
Array backing
1
0
7
1
3
2
12
3
9
4
5
5
A binary heap: every parent is smaller than its children (min-heap). The root is always the minimum.
Root / activeComparingSwapping

About Priority Queue (Heap)

A binary heap that always serves the highest-priority element first. Insert sifts up and extract sifts down in O(log n); peek is O(1). Switch between a min-heap and a max-heap.

Time complexity: O(log n). Space complexity: O(n).

Use the interactive visualizer above to run Priority Queue (Heap) on your own input and watch every comparison, swap, and operation animate step by step — pause, scrub, or replay at any speed.