The Gateway to Computer Science Excellence
+2 votes

Consider double hashing of the form

$h(k,i)=(h_1(k)+ih_2(k)) \text{mod m}$ where $h_{1}(k) = \text{k mod m} \ , \ \ h_{2}(k)=1+(\text{k 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?

  1. $255$
  2. $256$
  3. $257$
  4. $258$
in Algorithms by Veteran (424k points)
edited by | 177 views

2 Answers

+1 vote

Option c is right. 

by Boss (35.6k points)
0 votes

3rd is the correct answer .

1st time key will go to 80th slot , 2nd time key will go to 337th slot

DIFFERENCE =337-80 = 257th slot


by (53 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,492 answers
100,706 users