Store of value is an asset, commodity, or currency that maintains its value without depreciating. In other words, to enter this category, the item acquired should, over time, either be worth the same or more. But we need to store and find value as fast as possible.
Hash table (hash map), data structure type, can map keys to values, A hash function use a hash function to compute index (hash code) into array of buckets (slots), from which the desired value can be found.
The key is hashed and resulting hash indicates where the corresponding value is stored.
Function that convert key → index
Key can be string, int, … , with string change it into ASCII format
Index is int range (0 → TABLE_SIZE - 1 ) with TABLE_SIZE is len(hash_table)
We have 22, 3, 18, 29
f(k) = hash(k) = k mod 10
22 mod 10 = 2
3 mod 10 = 3
18 mod 10 = 8
29 mod 10 = 9
A collision occurs when more than value to be hashed by particular hash function to same slot in table
If hash(k1) = hash(k2), k1 ≠ k2, means that collision
To solve the collision we use chaining or re-hash