Trie (Prefix Tree)
Trie (Prefix Tree)
A Trie (pronounced "try", from retrieval) is a tree-based data structure designed for storing and searching strings with shared prefixes. Unlike a HashMap, a Trie lets you search by prefix in O(m) time where m is the length of the word — making it the backbone of search autocomplete, spell checkers, and IP routing.
Video Explanation
