Pattern
Tries
Use a trie when many strings share prefixes and you must answer prefix questions fast. Each step down the tree spends one letter, so a lookup costs the length of the word, whatever the number of words. The price is memory for the nodes.