Submit your answer to this question via PC^2 under your account by the posted due time. No late submissions will be accepted. Note that homework is opened-book, but no outside assistance is permitted.
Double hashing greatly reduces clustering and is one of the best methods for hashing in open-addressed schemes. It uses two auxiliary pre-hashing
h1 ( k)
h2 ( k )
, such that the hashing function h ( k , i ) is of the form:
h( k , i ) [ h1 ( k ) i h2 ( k )]mod m
The initial probe goes to the position of h1 ( k) and all subsequent probes go to
integer multiples of
h2 ( k )
positions further. Write a program that returns
message when a collision has been detected during insertion. Note that the size of hash table is fixed as 13 in this problem.
Collision has occurred for element 90 at position 12 finding new Position at position 6
Collision has occurred for element 77 at position 12 finding new Position at