Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2018 | Question 69
  • Last Updated : 09 Jul, 2018

A hash table with 10 buckets with one slot per bucket is depicted here. The symbols, S1 to 57 are initially entered using a hashing function with linear probing. The maximum number of comparisons needed in searching an item that is not present is

(A) 4
(B) 5
(C) 6
(D) 3


Answer: (B)

Explanation: We have to consider different cases to find the maximum number of comparisons needed in searching an item that is not present.
If searching starts at 0 index : 3 comparisons will be made at index 0, index 1 and finally at index 2 and terminate searching when index 2 found empty.
Similarly after checking on different indexes, the maximum number of comparisons will be required if searching starts from index 8, as in this case, total 5 comparisons will be made at index 8, 9, 0, 1 and 2.

So, correct option is (B).

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :