Back to Demos
Algorithm Visualizer
Visualize sorting algorithms step by step. Watch how different algorithms compare and swap elements to sort an array.
Click "Play" or "Step" to start sorting
Unsorted
Comparing
Swapping
Sorted
Statistics
0
Comparisons
0
Swaps
Bubble Sort
Repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
Time:
O(n²)Space: O(1)