R
roger
Hi Folks,
I need to write two programs for a school assignment. One is an
"efficient" anagram program that will find all anagrams for a given
word by sorting all given letters of the supplied word and dictionary
which will then find all of the matching words.
The next version of the program (the "inefficient" example) is
supposed to try every combination of letters and find anagrams by pure
brute force by trying every combination of letters up to
len($suppliedWord) in length.
I'm not looking for someone to do this for me, I'm looking for advice
on how do I go about trying every possible combination of letters. It
sounds pretty easy on the surface but as I think about it more it
seems to get messier and messier.
Does soemone know of a "clean" method I can use to iterate through
every possible combination of letters?
Thanks,
Roger
I need to write two programs for a school assignment. One is an
"efficient" anagram program that will find all anagrams for a given
word by sorting all given letters of the supplied word and dictionary
which will then find all of the matching words.
The next version of the program (the "inefficient" example) is
supposed to try every combination of letters and find anagrams by pure
brute force by trying every combination of letters up to
len($suppliedWord) in length.
I'm not looking for someone to do this for me, I'm looking for advice
on how do I go about trying every possible combination of letters. It
sounds pretty easy on the surface but as I think about it more it
seems to get messier and messier.
Does soemone know of a "clean" method I can use to iterate through
every possible combination of letters?
Thanks,
Roger