← Back to Algorithms

Bubble Sort

A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.

Current Operation

Click 'Sort' to start visualization

Step: 0/0

Time Complexity: O(n²)
Space Complexity: O(1)

How it Works

Step-by-Step Process:

1. Start with an unsorted array

2. Compare adjacent elements, swap if they are in wrong order

3. After each pass, the largest element "bubbles up" to the end

4. Repeat until no more swaps are needed