edited by
777 views
1 votes
1 votes

Following keys have to be inserted in exact order into the hash table with $9$ slots.

$5, 28, 19, 15, 20, 33, 12, 17, 10$

The auxiliary hash functions is $h(k)=K$ mod table size, where table size is $9$ . Which of the following represent the contents of the hash table in correct order after insertions are performed using linear probing?

  1. $12,28,19,20,10,5,15,33,17$
  2. $10,28,19,20,12,5,15,33,17$
  3. $33,28,19,20,12,5,15,10,17$
  4. $20,28,19,10,12,5,15,33,17$
edited by

1 Answer

Best answer
1 votes
1 votes

B is the answer because in linear probing we linearly probe for the next slot. Indexes will be from 0 to 8 since, the hash function is K mod 9.

selected by
Answer:

Related questions

0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
1,638 views
Three algorithms do the same task. Algorithm One is $O(N)$ and Algorithm Two is $O(\log N)$ and Algorithm Three is $O(N1/2)$. Which algorithm should execute the fastest f...
1 votes
1 votes
3 answers
3
0 votes
0 votes
0 answers
4