Intuition
Instead of searching every item, a hash table jumps close to where a key should be stored.
Technical definition
Hash tables use hash functions, buckets, and collision handling to support average-case constant-time lookup, insertion, and deletion.
Example
A dictionary object in many languages is implemented using a hash-table-like structure.
Common misunderstandings
- Hash tables can degrade with poor hashing or adversarial keys.
- They do not preserve sorted order by default.