Next:
Up:
Previous:
Double Hashing
h(k,i) = (
h
1
(k) + i
h
2
(k)) mod m
where
h
1
and
h
2
are auxiliary hash functions.
If
h
2
(
k
) and m have a common divisor, then not all of the table is probed.
Let
and
h
2
(
k
) = odd number
m = prime number,
{0, 1, ..., m-1}.
For example,
h
1
(
k
) = k mod m
h
2
(
k
) = 1 + (k mod m') where m' = m - 1.
Since each pair
h
1
(
k
),
h
2
(
k
) yields different probe sequences, the number of sequences is
, which is closer to ideal.
Next:
Up:
Previous: