batkins57 / gmail.com wrote:
> 
> So what you could do is first find all the possible permuations of the
> letters in your given word.  Then loop through the word file once.  If
> a word matches one of the permutations in your list, remove it from the
> list of words to be checked and push it onto a separate list.  This
> should be significantly faster, since you calculate the combinations up
> front, and then do one scan through the list.

Even faster - sort the list of permutations, then do an incremental
search against the dictionary: binary search to find the first word in the
list, then repeat, setting the lower bound of your search to the
position immediately after each match when you do the next one. 
O(m!*log n) rather than O(m log m * n), which for small m and large n
can lead to a speedup. It might be even faster to search for the middle
word in your permutation list, then do that recursively with the left
and right sublists, passing in the upper and lower bounds as arguments.
All this assumes an in-memory dictionary with O(1) position indexing, of
course.

martin