Bubble Sort & Early-Exit Optimization
Adjacent pairwise swaps bubbling maxima rightward, plus the `swapped` flag for O(n) sorted detection.
Related problems 1
-
Height Checker
Adjacent pairwise swaps bubbling maxima rightward, plus the `swapped` flag for O(n) sorted detection.