Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 All combinations
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Flikerator




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Flikerator




PostPosted: Sat Oct 14, 2006 3:22 pm   Post subject: (No subject)

Haha nice example Wink

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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: