Sorting Algorithm Visualiser
Watch sorting algorithms run step by step. Compare speeds, count operations, and understand exactly what each algorithm is doing at every stage.
Array Visualisation
Comparisons: 0
Swaps: 0
Unsorted
Comparing
Swapping
Pivot
Sorted
Bubble Sort
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.
Best: O(n)
Average: O(n²)
Worst: O(n²)
Space: O(1)
Stable: Yes