procedure to output all the n! combinations of the set s {1...n}
Date: 01/25/06
(Algorithms) Keywords: no keywords
I am trying to write a procedure to output all the n! combinations of the set s {1...n}
for example
n = 3 , s = 1 2 3 then I want to print out
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
I am still trying to do it but if you know right away an algorightm for doing this please let me know .. thanks
Source: http://community.livejournal.com/algorithms/71766.html