[pgh-pm] Algorithms for finding words that are bases of others

James O'Kane jo2y at midnightlinux.com
Fri Apr 11 15:33:29 CDT 2003


Earlier this semester for my Algorithms class we had to solve search words
(an NxN block of letters that have words hidden in them) using a de la
Briandias tree. One explaination of the datastructure is here:
http://www.cs.pitt.edu/~flying/CS1501/Recitation1.htm

For that assignment we were looking for prefixes, so things higher in the 
tree were merged based on the first letters. I haven't thought it through, 
but perhaps they could be inserted last letter first?
Or, when walking the tree, if you find an o on the same level as a string 
terminator, chec and see if the 'o' has a w and end of string following 
it.

The class is in c++ or java, so I'm not sure if this maps well to thinking 
in perl.

-james





More information about the pgh-pm mailing list