Why it matters
Perfect hashing gives O(1) guarantees vs expected. Foundation for static-set fast lookup.
Advertisement
The architecture
Level 1: hash into buckets.
Level 2: per-bucket perfect hash (quadratic space).
Total O(n) space.
Advertisement
How it works end to end
FKS 1984: two-level.
Expected O(n) construction.
Minimal perfect hashing: exactly n slots.
Rebuild for dynamic sets.