Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | Gate IT 2005 | Question 16

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads