< Previous Next >
[Design] [Trie] [Hash Table] [String]
Hint 1
Try to solve the first version first and reuse your code. Hint 2
To implement the delete function, you should delete the trie nodes of the word if they are not shared with other words. Hint 3
You should keep for each trie node a counter of how many words share this node.