5.3.2 How to Use Bubble Sort

The bubble sort makes multiple passes through a list. Each time through, it compares adjacent items and swaps items that are out of order. Each pass through the list picks up the largest remaining element and moves it as far to the right in the list as it can go - each item "bubbles" up to its correct position.