|
Permutations of elements
|
|
07-26-2009, 08:48 PM
Post: #1
|
|||
|
|||
|
Permutations of elements
This is a bit advanced algorithm for permutations of elements. It writes in file elements which you specified ! It uses recursive algorithm :
Code: program permutations_of_elements;There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
07-27-2009, 03:31 AM
Post: #2
|
|||
|
|||
|
RE: Permutations of elements
Impressive yet another algorithm that makes good use of recursion!
"Character is determined more by the lack of certain experiences than by those one has had." Friedrich Nietzsche |
|||
|
07-27-2009, 06:07 AM
(This post was last modified: 07-27-2009 06:09 AM by drdebcol.)
Post: #3
|
|||
|
|||
RE: Permutations of elements
(07-27-2009 03:31 AM)Back_track Wrote: Impressive yet another algorithm that makes good use of recursion!Yeah it basically tries every possible combination with class n ! And then checks if one number was used before, and if it is, it brakes that process and goes to another until it gets n different numbers in array, and then it just writes char array in order of integer array ! Number of permutations = factorial(n) . n ! = 1*2*3*...*n BTW This is 700th post on this forum ! There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
« Next Oldest | Next Newest »
|





