Hashing questions

Topics


Hashing

In the following, say our hash function for n is n % 20 and our second hash function, where applicable, is (n % 7) + 1.

Say we use separate chaining for collision resolution. Beginning with an empty hash table, we insert the following.

  8 38 3 5 28 18 65 83
How will the hash table look after the final insertion? If we then search for 48, how many of the inserted keys will we look at?

Answer.

Say we use linear probing for collision resolution instead. What is the answer to the above questions?

Answer.

Say we use double hashing for collision resolution. Now what is the answer to the above questions?

Answer.


Hashing / Review questions / 15-211 A, B