Multiple choice general knowledge

If you have a sorted, balanced binary tree with 15 elements in it, how many steps, maximum, will it take you to decide whether an element is present in the tree?

  1. 3

  2. 4

  3. 15

  4. depends on computer

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In a balanced binary tree, the maximum number of comparisons needed equals the tree height, which is log2(n) rounded up. For 15 elements, log2(15) ≈ 3.9, so 4 steps is the maximum. Option C (15) describes linear search, not binary search in a tree.