Binary Heap Builder Screensaver
The Binary Heap Builder screensaver inserts real random values into a live binary max-heap, drawn as an actual tree, each one bubbling up into correct heap order. It is free, runs in your browser, and ESC exits.
How the Binary Heap Builder screensaver works
The saver inserts a real random value at the next open leaf position of a binary tree, exactly where a real heap insert places it.
The new value then bubbles upward, swapping with its parent whenever it is larger, until real heap order is restored.
Once the heap fills to a set size, the saver repeatedly pops the real maximum from the root and re-heapifies downward instead.
After the heap fully drains, it holds briefly, then a fresh binary heap build begins from empty.
A worked example
A freshly inserted large value climbs several levels up the tree, swapping with each parent in turn, until it settles exactly where real heap order requires it to sit.
Settings & tips
- Accent recolours the actively swapping node.
- This is a real, correct binary max-heap implementation.
- The heap automatically empties and rebuilds once it fully drains.
Frequently asked questions
- Is this a real binary heap?
- Yes — a real, correct binary max-heap, with every insert and pop shown as an actual tree operation.
- What is heapify?
- The real process of moving a value up or down the tree until the heap-order property is restored.
- Is a key needed?
- No — it is a pure local computation.
- Is it free?
- Yes — free, no download, in your browser.