I am implementing a hash table in java and I have to define the hash function. I am following the MAD Form.
I read in internet:
The MAD method:
h2(y) = [(ay + b) mod p] mod N
, whereN
is the size of the hash table,p
is a prime number larger thanN
, anda
andb
are integers chosen at random from the interval[0, p-1]
, witha > 0
.
Which number should be P
? How larger than N
?