Open Addressing, Tombstones, and Rebuilding
Explain why a deletion must preserve the probe path and distinguish live occupancy from occupied-or-deleted slots.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
An empty slot certifies absence along a probe sequence
In linear probing, search walks from the initial hash position until it finds the key or an unused slot. Suppose two keys start at index four and occupy slots four and five. Replacing the first with a never-used marker would make the second lookup stop too early at four. Mark the slot as a tombstone, which forces searches to keep probing.
Reuse a tombstone only after checking for duplicates
During an insertion remember the first tombstone and continue until the key is found or an unused slot proves absence. Then update the existing entry or place the fresh key in the remembered slot. Bound the walk by the table size even if no unused slot remains. Tombstones can accumulate while the live load stays low, so rebuild based on both live size and occupancy including tombstones. Robin Hood probing needs compatible deletion behavior to preserve its displacement rule. Amortized analysis can spread rebuild work over earlier changes.[1]