Algorithms and Data Structures · Junior · Question 13 of 75
What is a collision in a hash table?
- ✓Correct answer: Two different keys end up with the same bucket index
- 2A key is inserted twice with the same value
- 3Two threads write to the table at the same time
Explanation
There are more possible keys than buckets, so different keys sometimes hash to the same index. Tables handle this with chaining (a list per bucket) or open addressing (probing the next free slot).