Question discussion

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…

5189Medium DSSSB TGT Computer Science 0 replies 0 views
0
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 mode 9 and linear probing.
At what index key 13 is inserted?
  • A4
  • B6
  • C5
  • D7
Correct answer: B

Explanation

h(k) = k mod 9: 22→4, 28→1, 23→5, 12→3. For 13, h = 4 is occupied, 5 is occupied, so linear probing places it at index 6.

Discussion 0

Nobody has replied yet. Start the discussion!