retagged by
13,681 views
24 votes
24 votes
Consider a double hashing scheme in which the primary hash function is $h_1(k)= k \text{ mod } 23$, and the secondary hash function is $h_2(k)=1+(k \text{ mod } 19)$. Assume that the table size is $23$. Then the address returned by probe $1$ in the probe sequence (assume that the probe sequence begins at probe $0$) for key value $k=90$ is_____________.
retagged by

2 Answers

Best answer
38 votes
38 votes
In double hashing scheme, the probe sequence is determined by $(h1(k) + ih2(k))\mod m$, where $i$ denotes the index in probe sequence and $m$ denotes the hash table size.

Given $h1(k)$ and $h2(k)$, we have to determine the second element of the probe sequence (i.e. $i = 1$) for the key $k = 90$.

$(h1(90) + 1*h2(90))\mod 23 = (21 + 15)\mod 23 = 36\mod 23 = 13$
selected by
10 votes
10 votes
for double hashing,h'(k)=(h1(k)+i*h2(k))modm

where h1(90)=90 mod 23,h1(90)=21

and

h2(90)=1+90mod 19

h2(90)=15

i=1

h'(90)=(21+15)mod 23

h'(90)=13

ans is 13
Answer:

Related questions

8 votes
8 votes
4 answers
1
Arjun asked Feb 12, 2020
9,636 views
Consider a graph $G = (V,E)$, where $V = \{v_1,v_2, \dots ,v_{100}\}$, $E = \{(v_i,v_j) \mid 1\leq i < j \leq 100\}$, and weight of the edge $(v_i,v_j)$ is $\mid i – j ...
15 votes
15 votes
5 answers
2
Arjun asked Feb 12, 2020
9,053 views
Let $\mathcal{R}$ be the set of all binary relations on the set $\{1,2,3\}$. Suppose a relation is chosen from $\mathcal{R}$ at random. The probability that the chosen re...
15 votes
15 votes
4 answers
3
Arjun asked Feb 12, 2020
9,071 views
Let $G$ be a group of $35$ elements. Then the largest possible size of a subgroup of $G$ other than $G$ itself is _______.
12 votes
12 votes
2 answers
4