Store words in a trie; wildcard . branches to all children.
addWord: standard trie insertion.search: DFS over trie.
.: try all children.The trie represents all stored words by prefixes; wildcard matching corresponds to exploring all possible next letters at that position.
Store words in a trie; wildcard . branches to all children.
addWord: standard trie insertion.search: DFS over trie.
.: try all children.The trie represents all stored words by prefixes; wildcard matching corresponds to exploring all possible next letters at that position.