0
$\begingroup$

My whole life I thought

a collision is a situation that occurs when two distinct pieces of data have the same hash value.

Everything looks a little bit different now: A few days ago we had to analyse common collision resolution strategies to handle the event that at least two keys being hashed to the same slot of an ordinary hash table. As mentioned above, to my knowledge (as well as my intuition) when inserting the very same key $k$ – that is already assigned to a slot of a hash table $T$ – again, nothing (special) happens and $T$ remains unchanged.

I wonder now, if i misunderstood this basic concept, since my professor claims, that inserting the key $k$ into a hash table $T$ again will lead to a collision anyway and we have to analyse some collision resolution strategies in this case too …

Many thanks in advance for your help and clarification! 🙌

$\endgroup$
  • $\begingroup$ Well, I suppose it's not that interesting to say that you have a collision if you reinsert a key that is already in the table. It gets more interesting if that can happen for two distinct keys as you say. It seems that you know that collisions (obviously) happen for the same keys, but less obviously also when the keys are distinct. $\endgroup$ – Juho Jan 24 at 20:42
  • 1
    $\begingroup$ Whether and how two things are (considered) the same or different is sometimes one of the biggest, hardest and most confusing (philosophical and practical) questions and problems. I am not surprised if you or even your professor are getting confused or looking like trying to confuse others. $\endgroup$ – Apass.Jack Jan 24 at 21:49
  • $\begingroup$ How does your professor use her collision? It is a minor matter to call anything whatever she wants; it is probably more significant how the name/concept is used and whether it is used consistently, at least in her course. $\endgroup$ – Apass.Jack Jan 25 at 2:57
1
$\begingroup$

I suppose one could define the word however you like, but I've always understood it to mean the same thing you are talking about. Here I'm assuming if you try to insert a key the second time, no change is made, as it is already present. If inserting the key caused a second copy to be inserted somewhere, then I think it's more ambiguous and in any formal analysis it would be best to define precisely what you mean by a collision and state whether you consider that a collision, to avoid confusion.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.