Sorting Algorithm Visualizer

Visualization

5 15 30

Bubble Sort

Bubble Sort repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.

How it works:

Imagine you have a row of numbers. Bubble Sort starts from the left and compares each pair of adjacent numbers. If they're in the wrong order (larger number before smaller), it swaps them. After one complete pass, the largest number "bubbles up" to the end. It repeats this process until the entire array is sorted.

Unsorted
Comparing
Swapping
Sorted

Algorithm Complexity