What am I missing? Author claims that if you know that you have as an input the permuted numbers 1..n you can "sort" them? Why would you have to "sort" them, why not just create the order?
def quasiSort( a ):
return range( 1, len( a ) + 1 )
a = quasiSort( [ 3, 1, 2 ] )
print a