Overview
Cuckoo hashing gives each key two or more possible locations. Inserting a colliding key evicts the current occupant and relocates it to its alternate location until the table stabilizes or needs rebuilding.
Resolves hash collisions by moving keys between multiple candidate buckets.
Compact metadata for implementation and discovery.
Cuckoo hashing gives each key two or more possible locations. Inserting a colliding key evicts the current occupant and relocates it to its alternate location until the table stabilizes or needs rebuilding.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(log n)
Worst
O(n)
Space
O(n)
Show placing each key in one of several hash-determined locations and relocating conflicts on a small dictionary storage example.
Cuckoo hashing makes lookup predictable by moving insertion complexity into displacement and rebuild handling.
What each reference supports for this entry.
Original reference for two-table cuckoo hashing, displacement chains, and worst-case lookup behavior.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Cuckoo hashing is a hash-table collision strategy.
Robin Hood hashing equalizes probe distances, while cuckoo hashing relocates keys among candidate buckets.
Both are hashing-based membership structures with different accuracy and storage tradeoffs.