recategorized
3,044 views
1 votes
1 votes

Consider a hash table of sze seven, with starting index zero, and a hash function (7x+3) mod 4. Assuming that 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? Here "____" denotes an empty location in the table.

  1. 3, 10, 1, 8, ___ , ____ , ____
  2. 1, 3, 8, 10, ___, ___, ___
  3. 1, ___, 3, ___, 8, ___, 10
  4. 3, 10, ___, ____, 8, ___, ___
recategorized

1 Answer

1 votes
1 votes
Put the values 1,3,8,10 in Hash Function.

For 1 -> (7*1+3) mod 4 = 2 , So 1 will go at location 2.

For 3-> (7*3+3) mod 4 = 0, So 3 will go at location 0.

and so on.

Option (1) is correct.

Related questions

0 votes
0 votes
2 answers
1
Pooja Khatri asked Jul 13, 2018
8,888 views
A hash function h defined h(key)=key mod 7, with linear probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the ...
1 votes
1 votes
3 answers
2
Pooja Khatri asked Jul 13, 2018
3,340 views
Consider the array A=<4, 1, 3, 2, 16, 9, 10, 14, 8, 7>. After building heap from the array A, the depth of the heap and the right child of max-heap are ______ and _____ r...
0 votes
0 votes
2 answers
3
Pooja Khatri asked Jul 13, 2018
2,570 views
Which of the following algorithms solves the single-source shortest paths?Prim's algorithmFloys-Warshall algorithmJohnson's algorithmDijkstra's algorithm
0 votes
0 votes
8 answers
4