Picks two pivots p1 ≤ p2 and partitions the array into three regions in a single pass: elements < p1, elements between p1 and p2, and elements > p2; each region is then sorted recursively.
Three partitions instead of two reduce average comparisons by roughly 5/9 compared to single-pivot Quicksort; this exact algorithm is used by Java's Arrays.sort for primitive types.