Trie implementation of hashmap