Sorting Algorithm Visualizer

Interactive visualization of popular sorting algorithms

Algorithm Selection

Array Controls

Animation Controls

Slow Fast

Statistics

Comparisons: 0
Swaps: 0
Array Access: 0
Time: 0ms

Bubble Sort

Repeatedly compares adjacent elements and swaps them if they are in wrong order

Time Complexity:
Best: O(n) Average: O(n²) Worst: O(n²)
Space Complexity: O(1)

Color Legend

Default
Comparing
Swapping
Sorted
Pivot