Hash table average lookup
For a well-designed hash table, what are the average and worst-case lookup times?
Show hints (2)+
- The good case assumes few collisions.
- What if every key hashes to one bucket?
Answer
Reveal answer →Final 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.