Initializing Bubble Sort...
SortStory
Sorting Visualizer
Visualize and compare 16 sorting algorithms in real-time, side-by-side or individually.
INFO
Compares adjacent elements and swaps them if in wrong order. Simple but O(n²).
TIME: O(n²)SPACE: O(1)
VISUALIZATION
Comp0
Swap0
0ms
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
50
Unsorted
Active
Comparing
Sorted
Pivot
Algorithm Details (Python)
Best Case
O(n)
Average Case
O(n²)
Worst Case
O(n²)
Space Complexity
O(1)