Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I would think that "all letter arrangements of length N" would not be what you'd want to use for Boggle, because there are a ton of them and if you start with "q" and go to "qz", there is no point in looking up all possible Boggle sequences on the board in your dictionary to see if any of these "qz*" things are words. Spelling dictionaries are often stored in a trie which is like a big nested hash (but more efficient) where you feed in the letters of your potential word one at a time and can see when you've reached the point where no word starts with those letters. So I'd recurse over the board and over the trie in parallel, having the trie tell me when to move on (and when I've found a word). - tye In reply to Re: find all paths of length n in a graph (trie)
by tye
|
|