There is a permutation generator in the Collected Algorithms of ACM (long ago, so probably in the bound Vol. 1). You can also design a permutation generator by recursive application of the rule: Perm( N ) = { N-inserted-at-each-position-in-Perm( n-1 ) } This makes a pleasant programming exercise.