in DS edited by
5,850 views
16 votes
16 votes

Consider a hash table of size $11$ that uses open addressing with linear probing. Let $h(k) = k \mod 11$ be the hash function used. A sequence of records with keys

$43 \ 36 \ 92 \ 87 \ 11 \ 4 \ 71 \ 13 \ 14$

is inserted into an initially empty hash table, the bins of which are indexed from zero to ten. What is the index of the bin into which the last record is inserted?

  1. $3$
  2. $4$
  3. $6$
  4. $7$
in DS edited by
5.9k views

4 Answers

24 votes
24 votes
Best answer

$$\begin{array}{|c|c|} \hline \textbf{Index} &  \textbf{key}\\\hline 0 & 87 \\\hline 1 & 11 \\\hline 2 & 13 \\\hline 3 & 36 \\\hline 4 & 92 \\\hline 5 & 4 \\\hline 6 & 71 \\\hline \textbf{7} & \textbf{14} \\\hline 8 \\\hline 9 \\\hline 10 & 43 \\\hline  \end{array}$$

(D) is answer

edited by
8 votes
8 votes
Answer: D

The hash table looks like this at the end:

87,11,13,36,92,4,71,14,-,-,43
8 votes
8 votes

Answer D

Index Key
0 87
1 11
2 13
3 36
4 92
5 4
6 71
7 14
8  
9  
10 43

2 Comments

whats the difference when its said open addressing or closed addressing
?
1
1
Separate Chaining  = Open Hashing
Open Addressing = Closed Hashing
0
0
0 votes
0 votes
Answer:

Related questions