Last Updated :
20 Dec, 2018
The keys 123, 164, 232, 38, 195 and 253 are inserted into an empty hash table of size 11 using open addressing with the hash function H(key) = key mod 11. Which slot will remain empty?
(A) 0, 1, 4, 5, 10
(B) 0, 3, 4, 7, 8
(C) 1, 2, 6, 9, 10
(D) 1, 3, 7, 9, 10
Answer: (B)
Explanation:
123 mod 11 = 1
164 mod 11 = 9
232 mod 11 = 1
38 mod 11 = 5
195 mod 11 = 10
253 mod 11 = 5
The hash table will be:
Slot |
key |
0 |
– |
1 |
12
3
|
2 |
23
2
|
3 |
– |
4 |
– |
5 |
3
8
|
6 |
25
3
|
7 |
– |
8 |
– |
9 |
16
4
|
10 |
19
5
|
undefined
So, option (B) is correct.
Quiz of this Question
Share your thoughts in the comments
Please Login to comment...