AI engineering glossary · Data structures algorithms
What is collision?
Collision (also called hash collision): The situation where two different keys are mapped to the same slot by a hash function. Since slots are fewer than possible keys, collisions are unavoidable and every hash table needs a strategy to resolve them.
Collision: an example
With 8 slots, keys 'cat' and 'act' are anagrams and would land in the same slot if the function only adds character codes.
Related terms
More Data structures algorithms terms
- Comparison sort
- Connected components
- Consistent hashing
- Counting sort
- Cycle detection
- Data structure
- Depth-first search
- Deque
Where you learn it
Collision is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.