Algorithms and Data Structures · Middle · Question 53 of 75

What happens to a hash table when its load factor gets too high?

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).

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 53

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz