Trie is a special tree with multiple children and each node saves one char.
It's special for word insert/search with fast speed O(k), k is the word length.
Trie Tree Wrapper must implement AddWord and FindWord operations. Its algorithm are almost fixed.
Trie Node can be represented as
Hash
Array
Hash Trie and its operations
Array Trie and its operations
没有评论:
发表评论