Algorithm Visualizer

Interactive learning with step-by-step animations

Speed:1x
Data Structure
Operations

More Operations:

Step:0
Comparisons:0
Operations:0
Queue:0 steps
Understanding Heaps

A Heap is a complete binary tree where every parent node satisfies the heap property.

Max Heap: Parent ≥ Children | Min Heap: Parent ≤ Children

Common Uses:

Priority Queues
Heap Sort
Dijkstra's Algorithm
Memory Management
1

Complete Tree

All levels filled left to right. Stored as array!

2

Array Storage

Node i: Left=2i+1, Right=2i+2, Parent=(i-1)/2

3

Heapify

Restore heap property after changes

Heap Visualization
Select an operation to begin learning
8 elements
Empty Heap
Current
Found/Complete
Comparing
Default