What is the worst case time complexity of query operation(n is the no. of candidates)?

Category: QuestionsWhat is the worst case time complexity of query operation(n is the no. of candidates)?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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).


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701