Sort Target
Algorithm
Speed
Normal ~12s · 124 ms/step
Bottom-up merge sort(1948)
▶ Try this Source
O(n log n) ✓ Stable ✗ In-place
🔧 How it works

Treats every individual element as a sorted run of length 1, then iteratively merges adjacent runs and doubles the merge width each pass: 1 → 2 → 4 → 8 → … until a single sorted run spans the whole array.

🎯 Key property

Delivers identical O(n log n) stability and worst-case guarantee to top-down Merge sort while being fully iterative, no recursion, no call-stack overhead, and no need to compute split points.

👁 Watch for
  • RangeCopy adjacent runs of the current width are copied into a buffer before each merge
  • Compare the merge picks the smaller front value from the two buffer halves at each step
  • End of pass the active run width doubles after each full sweep; watch the merge boundaries grow from 1 to 2 to 4 to … until they span the whole array
Initial State
This is the array before sorting. Follow Bottom-up merge sort step by step.
Main Array
5
0
3
1
8
2
1
3
9
4
2
5
7
6
4
7
0 / 97 ops ( 0.0%) 0.0%
Sorting is
a spectacle.
Algorithms at work, in a daily vertical feed. Watch, play, challenge — and go deeper when you're ready.
Loading 0%
An unhandled error has occurred. Reload 🗙