Algorithms and Data Structures · Middle · Question 54 of 75
What makes a good hash function for a hash table?
- 1It produces a unique number for every possible key
- ✓Correct answer: It's fast and spreads keys evenly across buckets
- 3It keeps similar keys in neighboring buckets
Explanation
Even distribution keeps chains short. Uniqueness is impossible when there are more keys than buckets, and keeping similar keys together would cause clusters of collisions.