Sort Target
Algorithm
Speed
Normal ~12s · 48 ms/step
BlockQuickSort(2016)
▶ Try this Source
O(n log n) ✗ Stable ✓ In-place
🔧 How it works

Reorganises Quicksort's partition step into two separate phases: a comparison phase that fills small fixed-size index blocks with positions of out-of-place elements, then a swap phase that exchanges those indexed pairs in sequence.

🎯 Key property

Separating comparison from swapping eliminates the branch mispredictions that slow classic Quicksort on modern CPUs, the comparison phase accesses memory predictably and produces no conditional branches around swaps.

👁 Watch for
  • Compare elements are compared against the pivot in bulk to fill a block buffer with indices of out-of-place elements; no swaps occur during this phase
  • Swap once full blocks are collected on both sides, the indexed pairs are swapped in sequence; the swap pattern is data-independent and branch-free
  • End of partition leftover elements outside the filled blocks are handled with a short standard scan, then the pivot is placed at its final position
Initial State
This is the array before sorting. Follow BlockQuickSort step by step.
Recursion Tree
[0..31)51736248139151114101216211723192218202429253127302628
0 / 251 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 🗙