edited by
320 views

1 Answer

Best answer
2 votes
2 votes

It is $4$ .
In linear probing if a bucket is free the next bucket is filled .  I didnt get how they have implemented the hash function .

Consider the below table $h(x) = mod 10$

0  80
1 71
2 62
3  
4 44
5  
6 26
7 87
8 108
9  

Here  when you have to compare for ( say 90 )
You wil have to check buckets in location 0, 1, 2,3 .
3rd bucket is empty so search failed .  => 4 Comparisions

Like wise check for the worst case . Maximum we will have only 4 comparisions for any key

selected by

Related questions

0 votes
0 votes
1 answer
1
Ray Tomlinson asked Aug 9, 2023
509 views
Numerical Answer Type Que?(please Try to give some ahortcut trick also or important concept is there to solve that question )