Bubble Sort

Table of Contents

Bubble Sort

Time Complexity: O(n^2).

Concept: Repeatedly steps through the list, comparing adjacent elements and swapping them if they are in the wrong order.

Steps:

  1. Compare adjacent elements and swap them if they are out of order.
  2. Repeat the process until no swaps are made in a pass.

https://github.com/explorer436/programming-playground/blob/main/java-playground/my-java-solutions/src/main/java/com/my/company/sorting/algorithms/BubbleSort.java


Links to this note