edited by
21,741 views
37 37 votes

Consider a hash table of size seven, with starting index zero, and a hash function $(3x + 4)\mod 7$. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence $1, 3, 8, 10$ is inserted into the table using closed hashing? Note that − denotes an empty location in the table.

  1. $8$, −, −, −, −, −, $10$

  2. $1, 8, 10$, −, −, −, $3$

  3. $1$, −, −, −, −, −, $3$

  4. $1, 10, 8$, −, −, −,$ 3$

3 Answers

Best answer
35 35 votes

The answer is (B).

$1$ will occupy location $0, 3$ will occupy location $6, 8$ hashed to location $0$ which is already occupied so, it will be hashed to one location next to it. i.e. to location $1$.

Since $10$ also clashes, so it will be hashed to location $2$.

edited by
Answer:
Position:
Show:

Related questions

59 59 votes
4 answers 4 answers
24.8k
24.8k views
Arjun asked Feb 12, 2020
24,843 views
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)$. Ass...
39 39 votes
7 answers 7 answers
32.7k
32.7k views
Kathleen asked Sep 21, 2014
32,652 views
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is:$2^h -1$$2^{h-1} -1$$2^...
30 30 votes
7 answers 7 answers
13.0k
13.0k views
pC asked Dec 21, 2015
12,963 views
Consider the DAG with $V = \{1,2,3,4,5,6\}$ shown below.Which of the following is not a topological ordering?$1$ $2$ $3$ $4$ $5$ $6$$1$ $3$ $2$ $4$ $5$ $6$$1$ $3$ $2$ $4$...
25 25 votes
6 answers 6 answers
14.5k
14.5k views
Kathleen asked Sep 21, 2014
14,456 views
A process has been allocated $3$ page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence...