Sort It Out!

An interactive way to visualize sorting algorithms. Select an algorithm, generate an array, and watch it get sorted step-by-step.

Controls

Step: 0 / 0

Description

Bubble Sort 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 the list is sorted.

Complexity

Time Complexity

Best: O(n)

Average: O(n²)

Worst: O(n²)

Space Complexity

O(1)