Bubble Sort
Performance Metrics
Array Size: 40
Number of Swaps: 0
Elements Checked: 0
How it works
Bubble Sort is a simple way to sort a list by checking and swapping pairs of numbers that are out of order. Imagine lining up toy cars from smallest to biggest. You look at two cars at a time—if the bigger one is in front, you swap them. You keep doing this, and each time, the biggest car moves to the end. Eventually, all cars are in the right order. It’s slow for big lists but easy to understand. Bubble Sort has a time complexity of O(n²).