🧮Trie
Also known as Prefix Tree, Digital Tree
A tree that stores words letter by letter. Shared starts share a branch.
Think of it like
Think of it like a word tree. Words that start the same share the same branch.
Example
Lucy types "ca" into a search box. A trie of 100,000 words hands back cat, cake and car at once.
Why it matters
Search boxes that guess the next word, and spell checkers, are built on it.
Definition
Common mistake
Key takeaways
- 1One letter per step. Down from the root.
- 2Shared starts. Share one branch.
- 3Speed by length. Not by word count.