On 06/12/05, david <[EMAIL PROTECTED]> wrote: > suppose you have a list of words and you want to unambiguously identify > each word in the list with the shortest number of characters. > for instance a list like : kill, kiss, take > i would want to get take just by typing t. > but you would have to type kil or kis to get kill or kiss. > where should i start googling? is this a matter of sorting? > i was thinking of trees for some reason.
Look for tries :-) http://en.wikipedia.org/wiki/Trie or http://www.nist.gov/dads/HTML/trie.html I think there's a couple of good python implementations around that you could google for.. -- John. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor