Concept Flow - Why Trie Exists and What Hash Map Cannot Do for Strings
Start with empty Trie
Insert word character by character
Create nodes for each char if missing
Mark end of word
Search prefix or full word
Traverse nodes matching chars
If path exists, prefix/word found
Else, not found
Trie stores strings character by character in a tree, enabling prefix search and ordered traversal, which hash maps cannot do efficiently.
