All combinations
Author |
Message |
Flikerator
|
Posted: Sat Oct 14, 2006 2:40 pm Post subject: All combinations |
|
|
How would I find all the combinations of "A, B, C, D, E, F, and G"? Using each one only once. I know it could be done with recursion; but Im still fumbling with that concept.
Any help would be greatly appreciated.
I think there are 720 combinations, I just need each one, one by one. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sat Oct 14, 2006 2:54 pm Post subject: (No subject) |
|
|
A really simple example of recursion is found over at the wiki
It is an important consept though, and it would be best to understand it, over slapping together a work-around. I'm assuming that you know at least a little bit about recursion, so where should we start helping you? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Flikerator
|
Posted: Sat Oct 14, 2006 3:22 pm Post subject: (No subject) |
|
|
Haha nice example
I understand the concept of recursion, I just don't have the...I don't know, foundation. I haven't really implemented it before into a program. I can logic it out in my head a little; I know recursion could do it, I just don't know how.
B
C
D
E
F
G
I have the idea that if it was (It always starts with A);
2
3
4
5
6
7
I would start at two and then declare all of them at the highest. So the first one would be; {2,3,4,5,6,7|B,C,D,E,F,G}
The second time it would take the highest minus one, and then maybe take the left over. {2,3,4,5,7,6|B,C,D,E,G,F}.
Each time it goes back a column it would have to do it 1 more time, because it deals with 1 more number. At first it was G and F. It does that twice. When it has three E,F,G it would have to do it 6 times. With four it would have to do it 24 times.
Something like that, unsure where to start. I'm still trying though. |
|
|
|
|
![](images/spacer.gif) |
|
|