+1 vote
in Data Structures & Algorithms I by (110k points)
What is the worst case time complexity of query operation(n is the no. of candidates)?

(a) O(1)

(b) O(n)

(c) O(log n)

(d) O(n log n)

Query is from Trees in chapter Trees of Data Structures & Algorithms I

The question was asked by my college professor while I was bunking the class.

1 Answer

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

Best explanation: The worst case in a bin query occurs when all the candidates are concentrated in one bin. So in this case the time complexity is O(n).

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.