Puzzle: Array A contains elements whose keys are a permutation of the numbers zero through n-1. How fast can we sort A using swaps?
Well, O(n2) and ought to be easy, yes?
Can we do better?
5 3 0 4 6 2 7 1 9 8