Hash table average lookup

For a well-designed hash table, what are the average and worst-case lookup times?

Show hints (2)+
  1. The good case assumes few collisions.
  2. What if every key hashes to one bucket?

Answer

Reveal answer →

$O(1)$ average, $O(n)$ worst

Want the full step-by-step worked solution? It's part of Premium — along with a worked solution for every question in the bank.

Asked at: Citadel, Two Sigma

Related questions