ProgrammingVery hard

In a linear-probing table, slot 1 holds a tombstone and slot 2 holds key 6. A search for 6 begins at slot 1 (its hash). How many slots are examined before it is found?

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

Correct answer: A. 2

The search examines slot 1, which is a tombstone, so it continues, and finds 6 in slot 2. Two slots are examined.

More C Programming questions

Exams that ask this topic