Sort Target
Algorithm
Input
An input that partitions evenly. Pivot selection and delegation work as intended — this algorithm's usual flow
Speed
Normal ~12s · 42 ms/step
Pattern-defeating quicksort(2015)
▶ Try this Source
O(n log n) ✗ Stable ✓ In-place
🔧 How it works

An Introsort variant that tests the input for common structural patterns before each partition, sorted, reverse-sorted, many equal elements, and takes a fast path when structure is detected, otherwise using block partitioning and pivot shuffling.

🎯 Key property

Pattern detection lets it shortcut work on structured inputs that would cripple standard Quicksort; currently the algorithm behind Rust's slice::sort_unstable and a benchmark reference for unstable sorts.

👁 Watch for
  • Compare (pattern detection) a scan tests the input for existing order before each partition; if structure is found a fast path replaces the full partition step
  • Swap (block partition) when a full partition is needed, compare and swap phases are separated like BlockQuickSort; pivot-shuffling swaps also fire when a bad partition is detected
  • End of phase transitions between Quicksort, Insertion sort, and Heapsort are reactive to input structure, more frequent and earlier than in standard Introsort
Initial State
This is the array before sorting. Follow Pattern-defeating quicksort step by step.
Recursion Tree
[0..31)51736248139151114101216211723192218202429253127302628
0 / 286 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 🗙