<aside> <img src="/icons/home_green.svg" alt="/icons/home_green.svg" width="40px" />

Back to Home

</aside>

https://jennychen9827sbu.github.io/CAD281/bbsort.html

What Is Bubble Sort (bbsort)?

Bubble Sort is a simple sorting algorithm that compares and swaps adjacent elements until sorted.

Named because larger values "bubble up" to the end.


Why Use Bubble Sort?

šŸ‘ Pros šŸ‘Ž Cons
Simple O(n²) complexity
Learning tool Inefficient at scale

āœ… Best for teaching and tiny arrays.


How to Use It

Steps:

  1. Loop through array
  2. Compare pairs
  3. Swap if needed
  4. Repeat until sorted