← Back to Test

Problem 2 - Entrance Test

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

Correct: C

In a balanced binary search tree, the height of the tree is logarithmic with respect to the number of nodes (n). Searching involves traversing down the tree from the root to a leaf, thus the worst-case time complexity is O(log n). O(n) is linear, more typical of searching an unsorted array.