📞 0339-0387701 (WhatsApp) Contact

« Back to Computer

What is the time complexity of searching for an element in a balanced binary search tree?

A. O(1)
B. O(n)
C. O(log n) ✅
D. None of these

Correct Answer: C. O(log n)

Explanation

  • In a balanced binary search tree , the height is proportional to log n, ensuring efficient searches.
  • The time complexity is O(log n) as the search halves the tree at each step.