Quick Sort
Selects a pivot element, partitions the array around it, and recursively sorts the subarrays.
Interactive Visualization
Loading visualization…
Usage
src/sample/quicksort.ts
import { quickSort } from 'athro';
const arr = [2, 6, 3, 8];
const result = quickSort(arr);
Time Complexity
| Case | Time Complexity | Description |
|---|---|---|
| Best | O(n log n) | Balanced partitions |
| Average | O(n log n) | Typical pivot behavior |
| Worst | O(n²) | Already sorted input with poor pivot choice |