Algorithm Visualizer
Watch algorithms work step-by-step with beautiful animations
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
| Algorithm | Best | Average | Worst | Space | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) | ā |
| Selection Sort | O(n²) | O(n²) | O(n²) | O(1) | ā |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) | ā |
| Cocktail Shaker | O(n) | O(n²) | O(n²) | O(1) | ā |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | ā |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) | ā |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) | ā |
| Shell Sort | O(n log n) | O(n^1.3) | O(n²) | O(1) | ā |
| Comb Sort | O(n log n) | O(n²/2^p) | O(n²) | O(1) | ā |
| Radix Sort | O(nk) | O(nk) | O(nk) | O(n+k) | ā |
| Counting Sort | O(n+k) | O(n+k) | O(n+k) | O(k) | ā |