O
OpticTygre
I need to write a loop that prints all the combination possibilities of a
character array. Basically, taking a scrambled word, or a regular word, and
printing out all the combinations. The letters in the word will only be
used once. It sounds easy, but for some reason, I can't get the logic
straight in my head. The formula is as follows:
If n = the number or letters in the word, the C = the number of
combinations, so:
C = (n)(n - 1)(n - 2)....(n - (n - 1))
Or
C = (n)(n - 1)(n - 2)...(1)
I'm totally screwed up on the logic behind writing a loop (or nested loop)
that would take care of this. Any help is appreciated.
character array. Basically, taking a scrambled word, or a regular word, and
printing out all the combinations. The letters in the word will only be
used once. It sounds easy, but for some reason, I can't get the logic
straight in my head. The formula is as follows:
If n = the number or letters in the word, the C = the number of
combinations, so:
C = (n)(n - 1)(n - 2)....(n - (n - 1))
Or
C = (n)(n - 1)(n - 2)...(1)
I'm totally screwed up on the logic behind writing a loop (or nested loop)
that would take care of this. Any help is appreciated.