+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the worst case time complexity of insert function in the hash table when the list head is used for chaining?

(a) O(1)

(b) O(n log n)

(c) O(log n)

(d) O(n)

I want to ask this question from Hash Tables topic in section Hash Tables of Data Structures & Algorithms I

I had been asked this question in quiz.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
Correct option is (d) O(n)

The best I can explain: Worst case time complexity of insert function in the hash table when the list head is used for chaining is O(n). It is caused when a number of collisions are very high.

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

...