A hash table (hash map) iħażen key → value pairs u joffri medja O(1) insert, lookup, u delete. Taħdem billi tgħaddi kull key permezz ta' hash function li tmappaha għal index fl-array sottostant ("bucket").
Kif taħdem
text
key "cat" --hash()--> 3 buckets:
key "dog" --hash()--> 0 [0] -> ("dog", 5)
[1]
[2]
[3] -> ("cat", 9)
Eżempju
python
phone = {}
phone[] =
num = phone[]
phone[]
phone
