The order of preservation of the minimum perfect hash functions

I want to implement the OPMPH function for words in a C ++ dictionary. How can I do it?

Thank!

+3
source share
3 answers

Limit the word to 6 letters or less and you can make it work. Not very practical.

+1
source

If you need alphabetical order, use Trie or DAWG (as I recommended in your last question). For the order, in addition to the alphabet, I would use a binary tree (std :: map in C ++ is implemented with a red-black tree usually).

Implementing an order-saving hash container sounds like the mother of all early optimizations.

+1
source

Source: https://habr.com/ru/post/1726553/


All Articles