Trie
A trie stores strings along a path of characters. The cost follows the length of the key, not the number of keys.
Costs
| Category | Data Structure |
| Difficulty | Medium |
| Insert a key of length k | O(k) |
| Search a key of length k | O(k) |
| Memory | grows with shared prefixes |
Questions
What is Trie?
A trie stores strings along a path of characters. The cost follows the length of the key, not the number of keys.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.