45 views
Consider a hashing function that resolves collision by quadratic probing.Assume  the address space is indexed from 1 to 8.Which of the following location will never be probed if a collison occurs at a position 4?

a) 4                                       b)5

c)8                                        d)2
asked in DS | 45 views
0
0
Yes 5 should be the answer, to avoid primary clustering (to create a run of filled slots after the correct position) in case of linear probing we moved on quadratic probing (which still suffers from Secondary clustering)
0
This and link question is different.

I hope you saw that?
0

I have a question

In quadratic probing(or any open addressing) if there is collision we move to some other index if we still have collision we will go to some other index likewise we have to go through all the indices before saying that we don't have space to insert a new index.

So my point is we have to probe through all the indices in the worst says.

Here in this question if "Which of the following location will never be probed if a collision occurs at a position 4"

is replaced with "Which of the following location will never be probed immediate next if a collision occurs at a position 4" would give the answer as 5.

1
2