Algorithms and Data Structures · Middle · Question 53 of 75
What happens to a hash table when its load factor gets too high?
- ✓Correct answer: It grows the array and re-inserts (rehashes) all entries
- 2It switches to a sorted array and binary search
- 3It starts rejecting new keys until some are deleted
Explanation
The load factor is entries divided by buckets. When it passes a threshold, collisions become frequent, so the table grows, usually doubling. Rehashing is O(n) but rare, so inserts stay amortized O(1).