Questions: Hash Tables: Collision Resolution by Chaining

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A chained hash table has m=100 buckets and n=400 keys, distributed uniformly. What is the expected time to search for a key?

AO(1) — hashing always gives constant-time lookup regardless of how many keys are stored
BO(log n) — chains are kept sorted for binary search
CO(1 + n/m) — constant time to find the bucket, plus traversing an average chain of length 4
DO(n) — in the worst case all keys collide, so the average must be O(n)
Question 2 Multiple Choice

Why does deletion in a chained hash table avoid the 'tombstone marker' complication found in open addressing?

AChaining rehashes immediately after every deletion, so no marker is needed
BChaining does not support deletion; keys must remain until a full rehash
CDeleted nodes are simply unlinked from their chain, leaving other chains and probe sequences unaffected
DChaining uses doubly-linked lists, and tombstones are only required in singly-linked structures
Question 3 True / False

In a chained hash table, inserting a new key always takes O(1) time regardless of the current load factor.

TTrue
FFalse
Question 4 True / False

A chained hash table with load factor α = 8 will produce incorrect search results because the chains have overflowed.

TTrue
FFalse
Question 5 Short Answer

Explain why implementations rehash a chained hash table when the load factor exceeds a threshold, rather than simply allowing chains to grow indefinitely.

Think about your answer, then reveal below.