Binary Heap Visualizer — Insert & Extract-Max
Interactive binary max-heap — insert and extract-max with animated sift-up / sift-down, step controls and pseudocode. Runs in your browser.
Pseudocode
Run an operation to see its steps.
Avg · Worst
How to use
- 1 Type a number and press Insert — watch it "sift up" to its correct level.
- 2 Press Extract Max to remove the root and watch the heap "sift down".
- 3 Use Random to insert a random value, or Clear to empty the heap.
- 4 Step through any operation and follow the highlighted pseudocode.
Why use this tool
- See a binary max-heap as a tree, with the largest value always at the root.
- Watch sift-up after insert and sift-down after extract restore the heap property.
- Understand why insert and extract are both O(log n) — the height of the tree.
- Runs entirely in your browser. No signup, no uploads.
Frequently asked questions
What is a binary heap?
A binary heap is a complete binary tree stored in an array where every parent satisfies the heap property. In a max-heap each parent is ≥ its children (so the maximum is at the root); in a min-heap each parent is ≤ its children.
What is the time complexity of heap operations?
Insert and extract-max are O(log n) — they bubble a value up or down at most the height of the tree. Reading the max is O(1).
How is a heap stored in an array?
The tree is implicit: the node at index i has children at 2i+1 and 2i+2 and its parent at ⌊(i−1)/2⌋. No pointers are needed.
What are heaps used for?
Priority queues, heap sort, Dijkstra’s and Prim’s algorithms, and any task that repeatedly needs the largest (or smallest) remaining element.
What is Binary Heap Visualizer?
A Binary Heap Visualizer animates a binary max-heap — a complete binary tree (stored in an array) where each parent is greater than or equal to its children. It shows sift-up after an insert and sift-down after extracting the maximum, keeping the largest value at the root.
Binary Heap Visualizer is a free algorithm utility by Zerethon Tools. Interactive binary max-heap — insert and extract-max with animated sift-up / sift-down, step controls and pseudocode. Runs in your browser. Runs entirely in the browser — no signup, no upload.
- Category
- Algorithm
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. Binary Heap Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
Bubble Sort Visualizer
Animated bubble sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs entirely in your browser.
Open toolInsertion Sort Visualizer
Animated insertion sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Open toolSelection Sort Visualizer
Animated selection sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs in your browser.
Open toolMerge Sort Visualizer
Animated merge sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.