Consider the keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into aninitially empty hash table of length 10 using open addressing with hashfunction h(k) = k mod 10 and linear probing. Show all the requiredsteps clearly. What is the resultant hash table?
Answers
Answer:
Lamatiks That Is Really and the link of the plug-in you help us out at This In you are interested and I'll get back with you miss me jeans in notebook and make the link of exam and I am.
Step-by-step explanation:
12 mod 10 = 2
18 mod 10 = 8
13 mod 10 = 3
2 mod 10 = 2 collision
(2 + 1) mod 10 = 3 again collision
(using linear probing)
(3 + 1) mod 10 = 4
3 mod 10 = 3 collision
(3 + 1) mod 10 = 4 again collision
(using linear probing)
(4 + 1) mod 10 = 5
23 mod 10 = 3 collision
(3 + 1) mod 10 = 4 collision
(4 + 1) mod 10 = 5 again collision
(using linear probing)
(5 + 1) mod 10 = 6
5 mod 10 = 5 collision
(5 + 1) mod 10 = 6 again collision
(6 + 1) mod 10 = 7
15 mod 10 = 5 collision
(5 + 1) mod 10 = 6 collision
(6 + 1) mod 10 = 7 collision
(7 + 1) mod 10 = 8 collision
(8 + 1) mod 10 = 9 collision
So, resulting hash table
0
1
2 12
3 13
4 2
5 3
6 23
7 5
8 18
9 15