Module 11 · Trie · Trie Operations and Applications

Trie operations

A trie stores words one letter per node, so words that start the same share a path from the root. Watch Akshay's Trie class insert, search and startsWith: each one is a loop that walks temp down from the root, one letter at a time.

In the trie each node holds one letter (the root none), and a double ring marks a node where a word ends: that is what tells search("app") apart from startsWith("app"). word is the word of the current call.