Expected Hash Table Lookup Complexity

Coding
Hashing
Easy
What is the asymptotic expected lookup complexity of a well-designed hash table under standard assumptions?
Hint 1

Assume a good hash function spreads keys evenly and the load factor is kept bounded.

Hint 2

Think about the expected size of a single bucket's chain under these assumptions.

Show worked solution
  1. 1. State the standard assumptions

    Assuming simple uniform hashing and a load factor (elements per bucket) bounded by a constant, each bucket holds elements on average.

  2. 2. Conclude the expected complexity

    A lookup examines only the elements in its bucket's chain, which has constant expected size, giving expected lookup time.

Answer: O(1)

Related roles: Browse quant jobs

Related problems