edited by
974 views
0 votes
0 votes
A hash table of size 10 using open addressing with linear probing and hash function is h(k)= (k)mod10 , where k is key value , initially table is empty . Following keys are inserted into table in given order .

44,87,43,68,30,20,67

How many number of probes required to insert 17 in table after inserting above keys?
edited by

2 Answers

1 votes
1 votes
The answer would be 6 probes becoz linear probing has a formula we can say and that is hf(key,i) = hf(key) + i mod M(hash table size) where i € 0 to M-1 . Count the i which for 17 . There will be 5 collisions and 6 comparisons.  17 key will be inserted at index 2 .

Related questions

0 votes
0 votes
1 answer
1
Ray Tomlinson asked Aug 9, 2023
506 views
Numerical Answer Type Que?(please Try to give some ahortcut trick also or important concept is there to solve that question )
0 votes
0 votes
1 answer
3
Lucky sunda asked Dec 15, 2016
320 views