🔢 Sorting Algorithms

When you search on Amazon, it sorts millions of products in milliseconds. Watch how different sorting algorithms work step by step and compare their speed.

Designed with the WJEC specification in mind
⚙️

Controls

30
50
Default
Comparing
Swapping
Pivot
Sorted
Press Play to start or Step to go one operation at a time.
💡

Bubble Sort

BestO(n)
AverageO(n²)
WorstO(n²)
SpaceO(1)
Stable ℹ️Yes
In-place ℹ️Yes

Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass is repeated until the list is sorted.

📊

Statistics

Comparisons0
Swaps0
Accesses0
StatusReady