Bubble Sort

Bubble Sort is a simple sorting algorithm that works by repeatedly stepping through a list of items, comparing adjacent pairs, and swapping them if they are in the wrong order. Here's how it works in simple terms:

  1. Start at the beginning: Look at the first two items in the list.
  2. Compare: If the first item is greater than the second item, swap them.
  3. Move to the next pair: Move one position to the right and compare the next two items.
  4. Repeat: Continue this process for the entire list. After one complete pass, the largest item will "bubble up" to the end of the list.
  5. Repeat the process: Go back to the start of the list and repeat the steps, ignoring the last sorted items (since they are already in place).
  6. Finish when sorted: Keep repeating until you make a pass without any swaps, which means the list is sorted.

Speed