1.

What is the search complexity in direct addressing?(a) O(n)(b) O(logn)(c) O(nlogn)(d) O(1)Asked question is from Hash Tables in division Hash Tables of Data Structures & Algorithms IThis question was addressed to me in a national level competition.

Answer»

Correct option is (d) O(1)

The explanation is: SINCE every KEY has a unique array position, SEARCHING TAKES a CONSTANT time.



Discussion

No Comment Found

Related InterviewSolutions