Bubble Sort repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Best: | O(n) |
Average: | O(n²) |
Worst: | O(n²) |
O(1)
1. Start with the first element. 2. Compare the current element with the next element. 3. If the current element is greater than the next element, swap them. 4. Move to the next element and repeat step 2. 5. Continue this process until no more swaps are needed.
This tour will guide you through the features of our sorting algorithm visualizer.