https://research.cs.vt.edu/AVresearch/hashing/deletion.php
The above webpage says this.
"If a tombstone is encountered when searching along a probe sequence, the search procedure continues with the search. When a tombstone is encountered during insertion, that slot can be used to store the new record."
I don't quite get why the second sentence works. Suppose, that three keys k1, k2, k3 all have the same hash. With open addressing linear probing, they are inserted to a hash table. The hash table buckets look like this. k1 is at the position pointed by the hash value.
... k1 k2 k3 ...
Now delete k1. The hash table becomes the following, where T indicates a tombstone.
... T k2 k3 ...
Then, I insert k3 again, it reaches T first then get it used, so I end up with two k3's in the hash table. This does not make sense to me.
... k3 k2 k3 ...
Could anybody explain why the second sentence makes sense?