Tries store strings with shared prefixes.
Each node represents a character, paths spell words. Core Operations:
- Insert: , create nodes along path
- Search: , follow path, check isEndOfWord
- Prefix: , like search but no end check
Patterns:
- Wildcard search with DFS
- Word dictionary with isEndOfWord flag
- Autocomplete with prefix traversal
When to Use: String prefix problems, dictionary lookups, autocomplete systems.
Time: per operation. Space: worst case.