Visualize Bubble Sort step by step. Watch adjacent elements get compared and swapped, and see the largest values "bubble up" to the end each pass. O(N²) time complexity explained.
Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Compare the first two elements. If the first is greater than the second, swap them.
Move to the next pair of adjacent elements and repeat. Continue to the end of the array.
After the first pass, the largest element "bubbles up" to the end. That position is now sorted.
Repeat the process for the remaining elements until no more swaps are needed.
While simple to understand, Bubble Sort is highly inefficient for large datasets.