What are Tries?

Tries, also known as prefix trees, are tree-like data structures used for storing and retrieving a dynamic set of strings. They are particularly efficient for searching and retrieving strings with common prefixes.

Advantages of Tries

Applications: Auto-complete for

  1. Browser History
  2. Code Completion
  3. Spelling Suggestions


Below is a simple example of a trie:

Trie Example

Learn More

To learn more about Tries, you can visit the Wikipedia page on Tries.