SortWise: Bubble Sort Visualizer

20
100
50ms
4

Bubble Sort Algorithm Explanation

Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.

How it works:

  1. Compare the first two elements.
  2. If the first element is greater than the second element, swap them.
  3. Move to the next pair of adjacent elements and repeat step 2.
  4. Repeat steps 1-3 until the end of the list.
  5. The largest element will "bubble" to the end of the list.
  6. Repeat the process for the remaining unsorted elements.

Visualization by Firebase Studio