Sorting Visualizer

Watch how different algorithms sort data in real-time.

CANVAS_VIEW_01

Bubble Sort

Description

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

Simply Explained

"Imagine a line of people waiting for a photo. You look at the first two people. If the taller one is on the left, they swap places. Then you move to the next pair. You keep doing this until the tallest person 'bubbles' up to the far right end. Then you start over, but stop one person earlier, until everyone is in height order."

Time Complexity

O(n²)

Space Complexity

O(1)