dsastrings
When is a trie worth the extra space?
Anonymous
A trie is useful when many keys share prefixes and prefix lookup matters. Each step follows one character, so lookup work grows with query length when child lookup is constant time. The trade-off is extra nodes and pointer storage compared with a compact array of strings.
0