Tries
The trie is a kind of tree that’s ideal for text-based features such as autocomplete. Before we get into how the trie works, though, let’s first address its pronunciation.
In my (unasked for) opinion, the trie is one of the most unfortunately named data structures out there. The word trie is derived from the word retrieval. So technically, it should be pronounced “tree.” But since that would be confused with the word tree, which is the general term for all tree-based data structures, most people pronounce trie as “try.” Some resources refer to this same data structure as the prefix tree or the digital tree, but trie, amazingly, remains the most popular name. So there you have it.
Here’s one last comment before we dive into the details. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access