Loading...
Interactive walk through the in-place partition process: scanning pointer j advances, boundary i grows the ≤ pivot prefix, then a final swap positions the pivot.
1function quickSort(arr, lo, hi):2 if lo >= hi: return3 p = partition(arr, lo, hi)4 quickSort(arr, lo, p-1)5 quickSort(arr, p+1, hi)
Partition grows a contiguous ≤ pivot prefix via conditional swaps; pivot swap finalizes its location; recursion applies the same scheme to left and right segments until base segments of size ≤1 remain.