Trivia ForgePlay free →

What is the worst-case time complexity of searching for an element in a Hash Table of size m containing n elements when using chaining?

Show answer

O(n)

In the worst case, all n keys hash to the same slot, creating a single linked list of length n. However, under the assumption of simple uniform hashing, the average-case search time is O(1 + alpha), where alpha is the load factor.

Would you remember this in 6 months?

Trivia Forge uses spaced repetition so facts stick. Free, no signup needed.

Turn on Algorithms practice →

More Algorithms trivia

See all 83 →