1.

What is the time complexity of insert function in a hash table using a doubly linked list?(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)My question is taken from Hash Tables in division Hash Tables of Data Structures & Algorithms IThis question was addressed to me in quiz.

Answer»

The correct option is (a) O(1)

Easy explanation - Time complexity of INSERT function in a HASH table is O(1). Condition is that the number of COLLISIONS should be low.



Discussion

No Comment Found

Related InterviewSolutions