Tracing insertions around a tombstone

A hash table has 11 slots, numbered 0 to 10, and uses double hashing with h1(k)=k mod 11h_1(k) = k \bmod 11 and h2(k)=1+(k mod 7)h_2(k) = 1 + (k \bmod 7); probe ii is slot (h1(k)+i⋅h2(k)) mod 11(h_1(k) + i \cdot h_2(k)) \bmod 11. A removal leaves a tombstone. An insertion probes until it reaches an empty slot, confirming the key is absent, and then stores the key in the first tombstone it passed, or in that empty slot if it passed none. Starting from an empty table, perform: insert 35, insert 46, insert 57, remove 46, insert 123, insert 18. For each key still in the table, give its final slot and the number of slots its insertion examined.

KeyFinal slotSlots examined
35
57
123
18

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Double Hashing and Removal Questions: