Prefix Search
Learn Prefix Search (Trie, Advanced DSA) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Counting Words With a Given Prefix Augment each Trie node with a counter tracking how many words pass through it - answering "how many words start with X" becomes an O(prefix length) lookup instead of scanning every stored word.