Definition. Hash table collisions

[comp1110-4S]

A collision occurs when two distinct keys hash to the same position in a hash table's backing array. Since there are (usually) infinitely many possible keys but only finitely many positions, by the pidgeonhole principle collisions are unavoidable for any hash function. A good hash function minimises their frequency; a collision resolution strategy determines what the table does when they occur.

bars magnifying-glass caret-down plus minus arrow-right xmark