By trie map, I mean an associative array where the payload is stored in a trie instead of a hash table.
When I use a hash map / table, the keys I use are usually strings. What are the advantages of a hash map over some three-dimensional map? I read that the hash map is faster - but it seems to me that sequential hash functions would have to check each element of the array (char) for the final hash - iterate through the array once. In trie, you would also need to iterate over the array only once.
It seems to me that when encoding small objects it will use much more memory (even if you only allow alphabetic letters in keys, these are 26 pointers to a node and often several nodes per key), but on the plus side, you never have to worry about resizing . Why hash maps are so common, but have I never seen a trie map?
source share