Afterglowscreensavers

Binary Search Tree Builder Screensaver

The Binary Search Tree Builder screensaver grows a real, unbalanced binary search tree live from a stream of random inserts. It is free, runs in your browser, and ESC exits.

Live preview

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Binary Search Tree Builder screensaver works

The saver generates a real random value and inserts it starting at the root, going left or right at each node exactly the way a real BST insert works.

The new value settles into its correct real position — smaller values end up to the left, larger ones to the right, all the way down.

With no rebalancing, a run of similar values can genuinely make one side of the tree grow much deeper than the other, exactly like a real plain BST.

Once the tree reaches a set size, it holds briefly, then clears and a fresh binary search tree begins growing from empty.

A worked example

A long run of steadily increasing random values makes the tree lean hard to the right, growing tall and thin exactly the way a real unbalanced BST degrades toward a linked list.

Settings & tips

Frequently asked questions

Is this a real binary search tree?
Yes — a real, correct BST, with every insert following the real left-smaller, right-larger rule.
Why isn't it balanced?
Plain BSTs really do grow unevenly; this saver shows that real behavior rather than hiding it.
Is a key needed?
No — it is a pure local computation.
Is it free?
Yes — free, no download, in your browser.

← All Science & Research screensavers