Jump to content

Permutations: Difference between revisions

Line 1,517:
3 2 1</pre>
 
=== Alternate solution ===
 
Instead of looking up unused values, this program starts from [1, ..., n] and does only swaps, hence the array always represents a valid permutation.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.