Consider double hashing of the form
$h(k,i)=(h_1(k)+ih_2(k))\ \text{mod}\ m$
where
$h_1(k)=k\ \text{mod}\ m$
$h_2(k)=1+(k\ \text{mod}\ n)$
where $n=m-1$ and $m=701$.
For $k=123456$, what is the difference between first and second probes in terms of slots?
In double hashing, the difference between the first and second probe is decided by $h_2(k)$.
Here,
$m=701$
So,
$n=m-1=700$
Now,
$h_2(k)=1+($remainder when $123456$ is divided by $700)$
$123456=700\times 176+256$
So, remainder is $256$.
Therefore,
$h_2(k)=1+256=257$
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.