# UGCNET-June-2019-II: 66

1.5k views

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$

edited

Option c is right.

0

For calculating first and second probes it should be
1st Probe – (80+0*257) mod 701 = 80
2nd Probe – (80+1*257) mod 701 = 337
Thus making 337-80 = 257
No idea why have you written 256 in place of 257, I guess there was a mistake done by you though your answer was right….😅

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

## Related questions

1
804 views
Match List-I with List-II: ... (c)-(i); (d)-(ii) (a) - (ii); (b)-(i); (c)-(iv); (d)-(iii) (a) - (iii); (b)-(i); (c)-(iv); (d)-(ii)
There are many sorting algorithms based on comparison. The running time of heapsort algorithm is $O(n \text{lg}n)$. Like $P$, but unlike $Q$, heapsort sorts in place where $(P,Q)$ is equal to Merge sort, Quick sort Quick sort, insertion sort Insertion sort, Quick sort Insertion sort, Merge sort
Which of the following is best running time to sort $n$ integers in the range $0$ to $n^2-1$? $O(\text{lg } n)$ $O(n)$ $O(n\text { lg }n)$ $O(n^2)$