The Bubble Sort algorithm is a simple comparison-based sorting technique. It repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. This process is repeated until the entire list is sorted.
Key Characteristics:
Compare adjacent elements in the list. Swap them if they are in the wrong order. Repeat this process for all elements until no more swaps are needed.
Example: For a list of integers: [5, 2, 9, 1, 5, 6]
First Pass: [2, 5, 1, 5, 6, 9] Second Pass: [2, 1, 5, 5, 6, 9] Continue until sorted: [1, 2, 5, 5, 6, 9]