347 views

1 Answer

1 votes
1 votes
In the given order find the value of h(k) for each given key, here 21 will give h(k)=21%10=1 as h(1) is empty place 21 there.

Similarly for each key and when there's a collision.As in que it's given as use Quadratic rehashing i.e. H+1^2,H+2^2,H+3^2 and so on this is done to resolve collision.

So for 30 as key 20 already exist in 10 so collision

H(30) =30%10 =0 (collision)

Rehash taking 1^2= (H(30)+1^2)%10=1(as collision occurs again take 2^2 in place of 1^2

=(H(30)+2^2)%10=0+4%10=4 (index 4 is empty so collision is resolved)

Proceed in similar way for others.

Related questions

0 votes
0 votes
0 answers
1
akash.dinkar12 asked Apr 1, 2019
298 views
How does data encryption affect index schemes ? In particular, how might it affect schemes that attempt to store data in sorted order ?
0 votes
0 votes
1 answer
2
akash.dinkar12 asked Apr 1, 2019
1,677 views
Why is a hash structure not the best choice for a search key on which range queries are likely ?
0 votes
0 votes
1 answer
4
akash.dinkar12 asked Apr 1, 2019
665 views
What are the causes of bucket overflow in a hash file organization ? What can be done to reduce the occurrence of bucket overflows ?