Data Structures & AlgorithmsVery hardGATE CSE · Hashing

A hash table of size 7 with h(k) = k mod 7 and linear probing holds keys 3, 10, 17, 24 at indices 3, 4, 5, 6. Key 10 is then deleted by marking its slot as a 'deleted' tombstone (not empty). How many slots are examined to find key 24 afterwards?

  1. A. 2
  2. B. 3
  3. C. 5
  4. D. 4

Correct answer: D. 4

A search continues past tombstones and stops only at an empty slot or the key: indices 3, 4 (tombstone), 5 and 6 are examined.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic