in reply to Searching for a Permutation Algorithm for nPr where n != r
You may find useful help in the forthcoming volume of Knuth's The Art of Computer Programming. Knuth has preprints of parts of it on his web site. You'll need a postscript viewer (or printer) to look at them.
I transcribed one of the non-recursive permutation algorithms into Perl here.
|
|---|