recategorized by
1,371 views
1 votes
1 votes
Insert the following keys in an array of size $17$ using the modulo division method. Use double hashing to resolve collisions. Take $h'(k) = (\text{key%}7)+1$ as the second hash function: $94, 37, 29, 40, 84, 88, 102, 63, 67, 120, 122$. What is the value present at location $7$ ____
recategorized by

1 Answer

3 votes
3 votes
There will be no collisions when you insert the elements $94, 37, 29, 40, 84.$ Those elements are placed at the locations $9, 3, 12, 6, 16.$ When you are trying to hash the element $88$, it will collision at the location $3$, so we will apply double hashing on it. It will place at the location $8$. The final hash table is after hashing all elements
$\begin{array}{|c|c|} \hline \text{value} & \text{Location} \\ \hline 102 & 0 \\ \hline 120 & 1 \\ \hline & 2 \\ \hline 37 & 3 \\ \hline 67 &  4 \\ \hline &  5 \\ \hline 40 &  6  \\ \hline 122 & 7 \\ \hline 88 & 8 \\ \hline 94 & 9 \\ \hline & 10 \\ \hline & 11 \\ \hline 29 & 12 \\ \hline 63 & 13 \\ \hline & 14 \\ \hline & 15 \\ \hline 84 & 16 \\ \hline \end{array}$
Answer:

Related questions

1 votes
1 votes
1 answer
1
Applied Course asked Jan 16, 2019
525 views
Suppose a radix sort was done on the following set of numbers, in binary i.e,$[11, 10, 3, 14, 12, 2, 8, 15, 2]$. How many passes of counting sort would be performed _____...
1 votes
1 votes
1 answer
3
Applied Course asked Jan 16, 2019
727 views
$\begin{array}{l} A = 2000 \\ B = A - 999 \\ C = A + B - 998 \\ D = A + B + C - 997 \\ \vdots \\ \vdots \\ Z = A + B + C + \dots + Y - 975 \end{array}$How much $\frac{Z+1...
1 votes
1 votes
0 answers
4
Applied Course asked Jan 16, 2019
1,007 views
What is the maximum number of activation records inserted into stack while converting following infix expression to postfix expression is Infix expression: $\text{7+5*3^2...