Chaining (Hash Collision)

Chaining is to use a LinkedList along side with HashTable to resolve collision.

In the case where collision happens. We use a LinkedList to store for the same index.

For example:

Pasted image 20231107231505.png

If we have hash(austin) = 3, we can just insert it as a LinkedList

We have the following:

Pasted image 20231107231743.png

Next if we do hash(github, 4), supposed that we hae a hash collision. Therefore hash(github, 4) = 3. We can just extends it as a LinkedList

Pasted image 20231107231835.png

Doing this when searching, we also need to make sure we walk through all the possible LinkedList inside a cell as well. However we don't have the cyclic problem as Open Addressing (Hash Collision) because of the Probing Sequence