Question: 2. Hash Table Collision Resolution. Consider a hash table of size M = 11 and suppose we would like to insert the following non-negative integer

2. Hash Table Collision Resolution. Consider a hash table of size M = 11 and suppose we would like to insert the following non-negative integer keys in order: (20,30,31, 19, 15, 7, 61,0,3, 46) The hash function that is used by our hash table is the following: It is optional, but it would be easier for you to implement this hash function using any programming language so that you can quickly evaluate it on any value you like. int h(int k) { int x = (k + 7) * (k + 10); x = x * x; x = x + k; x = x mod 11; return x; (a) (10 points) Suppose that collisions are resolved via chaining. Show the final hash table (with the linked list contents) after inserting all the keys. Slot Linked List Contents 0 (b) (10 points) Suppose that collisions are resolved using linear probing where the new hash function is now defined as gk, i) = (h(k) + i) mod M given key k and probe number i. List the contents of the hash table after inserting all the keys: Slot Key 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
