aspose file tools*
The moose likes Java in General and the fly likes Permutations Generator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Permutations Generator" Watch "Permutations Generator" New topic
Author

Permutations Generator

P. Sagdeo
Ranch Hand

Joined: Nov 13, 2003
Posts: 67
Hello. I posted this in the bigginner forum, but since I saw similiar questions in the advanced forum, im posting it here too.
I need to create a permutations generator for a program that I am going to write. You would input how many numbers and it should output all the combinations (input 3 : output :
0,0,0
0,0,1
0,0,2
0,1,0
0,1,1
0,1,2
0,2,0
0,2,1
0,2,2
1,0,0,etc).
Anyone know of any good algorithms or something to get me started. I'm not sure where to begin.
Thanks,
Parth
don cline
Ranch Hand

Joined: Oct 10, 2003
Posts: 35
Parth,
Try the following:


Good luck
Don
 
 
subject: Permutations Generator