O(Visualize)

Interactive Sorting

Unsorted
Comparing
Swapping
Focus
Sorted

Live Action Notes

Waiting to start animation...

Execution Flow

5
Custom Array

Live Metrics

Comparisons
0
Array Access/Swaps
0
System Status Idle

Bubble Sort

Algorithm Overview
Time Complexity
Best Ω(n)
Avg Θ(n²)
Worst O(n²)
Space Complexity
Space O(1)

Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.