Skip to main content

Bubble Sort & Early-Exit Optimization

Adjacent pairwise swaps bubbling maxima rightward, plus the `swapped` flag for O(n) sorted detection.

Open the lesson