edited by
694 views

1 Answer

Best answer
1 votes
1 votes

Number of worst case comparisons in linear probing = Size of largest cluster + 1

In this case, we have two clusters of size $3$ $(abc, efg)$. Worst case can occur when we are searching for a non-existent element, that should have mapped to either the location of $a: 0$, or the location of $e: 6$.

So, number of comparisons in worst case for this Hash Table are:

Size of largest cluster + 1 $= 3 + 1 = 4$

Answer:

Related questions

0 votes
0 votes
1 answer
1
Himanshu1 asked Dec 16, 2015
779 views
0 votes
0 votes
1 answer
3
nandini gupta asked Jan 22, 2017
682 views
A hash table of length 100 uses chaining.What is the probability that all the values are hashed into the same slot after 5 insertions?
0 votes
0 votes
1 answer
4