You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Abhishek Rai A edited this page Jun 21, 2026
·
1 revision
Algorithms
Five classic sorting algorithms, all instrumented to emit a typed Step[] stream from src/lib/algorithms.ts.
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)
✅
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)
❌
Each step records the exact pointer positions and operation type (compare / swap / overwrite), which is what drives the live pointer chips and captions in the visualizer.
All algorithm logic is pure TypeScript with no dependencies and no side effects, making it easy to test or reuse outside the UI.