Fixed median-of-three pivot algorithm.