Consider the list= [34, 16, 2, 26, 80]
If the hash function is given by ([i] % 10), which of the elements will create a collision situation?
Consider the list= [34, 16, 2, 26, 80]
If the hash function is given by ([i] % 10), which of the elements will create a collision situation?
Solution
✅ Correct Option: 1
A collision occurs when two elements get the same hash value. Here the hash is the remainder on dividing by 10, which is the last digit of the number.
Only 16 and 26 share a hash value:
Related questions:
2025: 21 May Shift 1
2026: 23 May Shift 1