Trie data structure implementation.
