Balanced binary tree with n items allows the lookup of an item in ____ worst-case time.

Category: QuestionsBalanced binary tree with n items allows the lookup of an item in ____ worst-case time.
Editor">Editor Staff asked 1 month ago

Balanced binary tree with n items allows the lookup of an item in ____ worst-case time.
 
(a) O(log n)
 
(b) O(nlog 2)
 
(c) O(n)
 
(d) O(1)
 
My enquiry is from Binary Trees in division Binary Trees of Data Structures & Algorithms I
 
I had been asked this question in quiz.

1 Answers
Editor">Editor Staff answered 1 month ago

The correct answer is (a) O(log n)
 
Easiest explanation – Searching an item in balanced binary is fast and worst-case time complexity of the search is O(log n).