+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the time complexity of delete function in the hash table using list head?

(a) O(1)

(b) O(n)

(c) O(log n)

(d) O(n log n)

My question comes from Hash Tables topic in section Hash Tables of Data Structures & Algorithms I

This question was posed to me in final exam.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Correct choice is (a) O(1)

To explain: Time complexity of delete function in a hash table is O(1). Condition is that the hash function should be such that the number of collisions should be low.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...