Question: 1.Let A = {9, 11, 10, 5, 4}, show the hash tables (with the size m = 5) for these 5 numbers: 1. For chaining
1.Let A = {9, 11, 10, 5, 4}, show the hash tables (with the size m = 5) for these 5 numbers: 1. For chaining hash table, use the hash function h(x) = x mod 5. 2. For open addressing hash table, use the hash function h(x, i) = (x+i*h(x)) mod 5, where h(x)=1+(x mod 3). The variable i counts the number of trials from 0 to m-1.
Following Problem 1, we continue to input another 5 numbers {21, 1, 15, 32, 13}, and double the sizes of the hash tables (since 10 is not a prime number, we update m to be 11). Please show the new hash tables: 1. For chaining hash table, use the hash function h(x) = x mod 11. 2. For open addressing hash table, use the hash function h(x, i) = (x+i*h(x)) mod 11, where h(x)=1+(x mod 3). The variable i counts the number of trials from 0 to m-1.
In Problem 1 & 2, we set h(x)=1+(x mod 3) for open addressing hash table. Can we simply set h(x)=x mod 3 instead? Why?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
