Summary
Use
perfect_hashing for a
static_set of keys. It creates a
collision_free mapping from keys to table slots. Lookups are
O_1_lookup after you build the structure. Many implementations use
two_level_hashing with a
universal_hash_family to place keys. A
minimal_perfect_hash uses exactly n slots for n keys. Expect extra
preprocessing_time to construct the tables. Watch
space_complexity during the build. Queries are constant time and deterministic for the fixed set.