About hash table problem. 1. Consider the following hashtable: It was created wi
ID: 3580922 • Letter: A
Question
About hash table problem.
1. Consider the following hashtable:
It was created with the hash function H(x) = x % 9 and uses a quadratic collision scheme.
Suppose the element value 23 is inserted next into this table. What index will it get stored in?
a. It will get stored in index 2
b. It will get stored in index 4
c. It will get stored in index 7
d. It will get stored in index 8
e. It will get stored in index 5
2. consider the hash table:
It was created with the hash function H(x) = x % 9 and uses a separate chaining collision scheme.
Suppose the element value 37 is inserted next into this table. What index will it get stored in?
a. It will get stored in index 1
b. It will get stored in index 2
c. It will get stored in index 3
d. It will get stored in index 4
e. It will get stored in index 7
f. It will get stored in index 8
Index 0 1 2 3 4 5 6 7 8 element 81 10 63 14 42Explanation / Answer
1)
23%9=5
5+1=6
5+4=9%9=0
0+9=9%9=0
0+16=16%9=7
The answer is c.
2)
37%9=1
So the answer is a.