Selects the pivot as the median of the first, middle, and last elements, then performs the same in-place partition and recursion as basic Quicksort.
The median-of-three pivot is unlikely to be the extreme value, significantly reducing the probability of the O(n²) worst case on common patterns such as sorted or reverse-sorted input.