3 ms·
Or for the example of word frequencies in the article, a prefix trie.
by wffurr 6y ago
Or for the example of word frequencies in the article, a prefix trie.
- ziml77 6y agoI tried a trie with data that I thought would work perfectly with it. There were a good amount of shared prefixes. But it ended up performing worse than a hash map. I don't remember all the details now, but after seeing that I'll just keep reaching for hash maps first (unless I'm sure that there's only going to be a very small number of elements, then I'll just iterate in order over a vector).