Using an in-situ permutation, we can sort an array in one pass.