A hash table (hash map) stores key → value pairs and offers average O(1) insert, lookup, and delete. It works by running each key through a hash function that maps it to an index in an underlying array (a "bucket").
How it works
text
key "cat" --hash()--> 3 buckets:
key "dog" --hash()--> 0 [0] -> ("dog", 5)
[1]
[2]
[3] -> ("cat", 9)
Example
python
phone = {}
phone[] =
num = phone[]
phone[]
phone
