Afterglowscreensavers

Merge Sort Cascade Screensaver

The Merge Sort Cascade screensaver shows a real live merge sort as its actual recursion tree, splitting a shuffled array into halves and merging them back in sorted order. 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 Merge Sort Cascade screensaver works

The saver shuffles a real array, then recursively splits it in half over and over, drawing every level of the real recursion tree.

Once a segment is down to one element, the real algorithm begins merging pairs of sorted segments back together in order.

Each merge step is drawn live, comparing the fronts of two segments and taking the smaller one, exactly as real merge sort does.

Once the whole array merges back into one fully sorted segment, it holds briefly, then a fresh shuffle and cascade begins.

A worked example

Two small sorted segments of three elements each merge into one sorted segment of six, visibly interleaving their elements in the real comparison order merge sort actually uses.

Settings & tips

Frequently asked questions

Is this a real merge sort?
Yes — a real, correct recursive merge sort, with every split and merge drawn as it actually happens.
Why show the recursion tree?
It makes the real divide-and-conquer structure visible, not just the final sorted result.
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