Source: wikibot/bubble-sort

= Bubble sort
{wiki=Bubble_sort}

Bubble sort is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares adjacent elements, and swaps them if they are in the wrong order. The process is repeated until the list is sorted. It is called "bubble sort" because smaller elements "bubble" to the top of the list (or the beginning of the array). \#\#\# How it Works: 1. **Compare adjacent elements**: Starting from the beginning of the list, the algorithm compares the first two adjacent elements.