Algorithm Visualizer

Watch algorithms work step-by-step with beautiful animations

50
Comparisons: 0 Swaps: 0 Time: 0ms

šŸ—ŗļø Pathfinding Visualizer

Click to place walls. Green = Start, Red = End. Drag them to move.

Start End Visited Path Wall

🧮 Current Algorithm Analysis

Bubble Sort

Best: O(n) Avg: O(n²) Worst: O(n²) Space: O(1) Stable āœ“

Repeatedly swaps adjacent elements if they are in wrong order. Simple but inefficient for large datasets.

šŸ“š Algorithm Complexity Reference

AlgorithmBestAverageWorstSpaceStable
Bubble SortO(n)O(n²)O(n²)O(1)āœ“
Selection SortO(n²)O(n²)O(n²)O(1)āœ—
Insertion SortO(n)O(n²)O(n²)O(1)āœ“
Cocktail ShakerO(n)O(n²)O(n²)O(1)āœ“
Merge SortO(n log n)O(n log n)O(n log n)O(n)āœ“
Quick SortO(n log n)O(n log n)O(n²)O(log n)āœ—
Heap SortO(n log n)O(n log n)O(n log n)O(1)āœ—
Shell SortO(n log n)O(n^1.3)O(n²)O(1)āœ—
Comb SortO(n log n)O(n²/2^p)O(n²)O(1)āœ—
Radix SortO(nk)O(nk)O(nk)O(n+k)āœ“
Counting SortO(n+k)O(n+k)O(n+k)O(k)āœ“