Data Structures & AlgorithmsModerateGATE CS · DSA

Why is a tombstone (a 'deleted' marker) used instead of emptying a slot when deleting from an open-addressing hash table?

  1. A. An empty slot would cut the probe chain, so later searches for keys inserted after it would stop early and fail
  2. B. It allows the deleted key to be restored
  3. C. It keeps the load factor below 1
  4. D. It makes insertion O(1) in the worst case

Correct answer: A. An empty slot would cut the probe chain, so later searches for keys inserted after it would stop early and fail

Searches stop at the first empty slot. Emptying a slot in the middle of a cluster would hide keys further along the chain; the tombstone says 'keep probing' for searches but can be reused by inserts.

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

Exams that ask this topic