dsasearchingstrings
When does a trie earn its memory cost?
Anonymous
A trie answers a prefix query by walking one edge per character in the prefix, independent of how many complete words share it. The trade-off is memory for nodes and edges; a hash map of full words is often a better fit when queries are exact matches only.
0