Hashing Algorithm: Deleting an element in linear probing
While using Linear probing method to implement hashing, when we delete and
element, the position of the deleted element is declared as a tombstone/
mark it as deleted. Why can't we just shift all the elements from the
current position until the next empty element is encountered? Won't this
save the time when too many tombstones are encountered later and a
rehashing might be required? Am I missing something? Please tell me if I
need to clarify my question.
Thanks a lot!
No comments:
Post a Comment