Question 10Asked in DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3

The following keys 22, 28, 23, 12 and 13 are inserted into initially empty hash table of length 9 using open addressing with hash function h(k) = k mod 9…

The following keys 22, 28, 23, 12 and 13 are inserted into initially empty hash table of length 9 using open addressing with hash function h(k) = k mod 9 and linear probing. At what index key 13 is inserted?
  1. A4
  2. B5
  3. C6
  4. D7
Show answerHide answer

Correct answer: (C) 6

Explanation

22→4, 28→1, 23→5, 12→3. 13 mod 9 = 4 is taken, so linear probing tries 5 (taken), then 6, which is free. So 13 goes to index 6.

From DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3

This is question 10 of DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.