GATE | Gate IT 2005 | Question 16
A hash table contains 10 buckets and uses linear probing to resolve collisions. The key values are integers and the hash function used is key % 10. If the values 43, 165, 62, 123, 142 are inserted in the table, in what location would the key value 142 be inserted?
(A) 2
(B) 3
(C) 4
(D) 6
Answer: (D)
Explanation:
43->3
165->5 Â
62->2
123-> 3(occupied) Â So acc to linear probing 3+1=4
142 ->2(occupied),3(occupied),4Â (occupied) ,5Â (occupied) ->6
Therefore correct Answer D
Quiz of this Question
Please comment below if you find anything wrong in the above post
Please Login to comment...