← Back to All Algorithms
⚡ Quicksort (Lomuto Partition)
How It Works
Quicksort uses a divide-and-conquer strategy:
Pick a pivot
(we use the last element)
Partition
the array: elements ≤ pivot go left, elements > pivot go right
Recursively
sort the left and right partitions
Low:
-
High:
-
Pivot Value:
-
Click "Start" to begin the visualization
Pivot
Comparing
Swapping
Sorted
Reset
▶ Start
Step →
Complexity Analysis
Best/Average Case:
O(n log n) — Balanced partitions
Worst Case:
O(n²) — Already sorted (with last-element pivot)
Space:
O(log n) — Recursion stack
Stable:
No (standard implementation)