Algorithms and Data Structures · Senior · Question 54 of 75

What is the expected number of comparisons for a successful lookup in a hash table with chaining and load factor α?

Explanation

With uniform hashing a chain has α elements on average, and a successful search scans about half of it. That's why tables keep α below a constant such as 0.75: lookups stay a few comparisons long.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 54

Test yourself

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

Take this quiz