What is the time complexity of the delete function in the hash table using a binary tree?

Category: QuestionsWhat is the time complexity of the delete function in the hash table using a binary tree?
Editor">Editor Staff asked 4 weeks ago

What is the time complexity of the delete function in the hash table using a binary tree?
 
(a) O(1)
 
(b) O(n)
 
(c) O(log n)
 
(d) O(n log n)
 
Question is from Hash Tables in section Hash Tables of Data Structures & Algorithms I
 
I got this question in an interview.

1 Answers
Editor">Editor Staff answered 4 weeks ago

The correct choice is (a) O(1)
 
Explanation: 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.