Relative Content

Tag Archive for hashing

Sorting versus hashing

My problem is as follows. I have an array of n strings with m < n of them distinct. I want to create a one-to-one function which assigns each of the m distinct strings to the numbers 0 ... m-1. For example, if my strings are:

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.

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.

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.

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.