1.

What is the time complexity to insert an element into the direct address table?(a) O(n)(b) O(logn)(c) O(nlogn)(d) O(1)This is a very interesting question from Direct Addressing Tables in chapter Hash Tables of Data Structures & Algorithms IThis question was posed to me in examination.

Answer»

Right choice is (d) O(1)

The best I can explain: As every KEY has a unique array POSITION, it takes CONSTANT TIME to insert an element.



Discussion

No Comment Found

Related InterviewSolutions