Open In App

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

Article Tags :