Overview
A Hash Table maps each key to a hash code, uses that code to choose a bucket or slot, and resolves collisions when multiple keys land in the same place.
Stores key-value pairs in buckets chosen by a hash function for fast average-case lookup.
Compact metadata for implementation and discovery.
A Hash Table maps each key to a hash code, uses that code to choose a bucket or slot, and resolves collisions when multiple keys land in the same place.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(1)
Worst
O(n)
Space
O(n)
index = hash(key) mod capacityMaps a key hash into a table slot or bucket.
Show keys hashing into buckets with collisions handled in place.
Hash-table performance depends on the hash function, load factor, and collision strategy.
What each reference supports for this entry.
Textbook reference for the algorithmic family and analysis of Hash Table.
Good next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Core
Cuckoo hash tables are hash-table variants that use multiple hash locations and displacement chains.
Compare with thisData Structures · Core
Cuckoo hashing is a hash-table collision strategy.
Compare with thisData Structures · Core
Robin Hood hashing is an open-addressed hash-table variant that balances probe distances during insertion.
Compare with thisData Structures · Core
Bitsets trade sparse key flexibility for compact constant-time membership over a fixed universe.
Compare with thisHash lookup queries are implemented over hash table storage.
SipHash can protect hash tables from adversarial collision attacks.