Exam-style question
Try this first
A hash table uses the hash function h(key) = key modulo 7. The keys 10 and 17 are inserted. Explain what happens and describe how rehashing could be used to handle the result.
Answer and explanation
Concise answer
The key 10 produces 3 because 10 modulo 7 is 3.
Why this is correct
The answer identifies the equal hash values, defines the collision correctly and shows that rehashing must be checked because a second calculation can itself produce a collision.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
