1.

What is the time complexity to delete an element from the direct address table?(a) O(n)(b) O(logn)(c) O(nlogn)(d) O(1)Question is taken from Direct Addressing Tables in chapter Hash Tables of Data Structures & Algorithms II have been asked this question during an internship interview.

Answer»

Right choice is (d) O(1)

The explanation is: As every KEY has a unique array POSITION, it takes constant time to delete an element, although the DELETED position must be SPECIFIED by nil.



Discussion

No Comment Found

Related InterviewSolutions