1.

What is the average retrieval time when n keys hash to the same slot?(a) Theta(n)(b) Theta(n^2)(c) Theta(nlog n)(d) Big-Oh(n^2)My doubt is from Hash Tables in portion Hash Tables of Data Structures & Algorithms IThe question was posed to me in unit test.

Answer»

The correct option is (a) Theta(n)

Easy explanation - The AVERAGE RETRIEVAL TIME when n keys HASH to the same slot is given by Theta(n) as the COLLISION occurs in the hash table.



Discussion

No Comment Found

Related InterviewSolutions