Algorithm Race
Which sorting algorithm wins?
Race 6 classic sorting algorithms head-to-head on identical data. Change the input type and watch the winner change. See exactly why algorithm choice matters for GCSE and A-Level CS.
Speed
Slow
Normal
Fast
Very Fast
Max
Input Type
Random
Nearly Sorted
Reversed
Few Unique
Start Race
Reset
Race Complete
Place
Algorithm
Total Steps
Comparisons
Swaps / Writes
Copy and Share Result
Copied to clipboard - share it with your class!
Show Complexity Reference
Algorithm
Best Case
Average Case
Worst Case
Space
Stable?
Bubble Sort
O(n)
O(n²)
O(n²)
O(1)
Yes
Insertion Sort
O(n)
O(n²)
O(n²)
O(1)
Yes
Selection Sort
O(n²)
O(n²)
O(n²)
O(1)
No
Merge Sort
O(n log n)
O(n log n)
O(n log n)
O(n)
Yes
Quicksort
O(n log n)
O(n log n)
O(n²)
O(log n)
No
Shell Sort
O(n log n)
O(n log² n)
O(n²)
O(1)
No