Question: If a binary search is performed on an array of size 16, how many comparisons are needed in the worst case?
Options:
Correct Answer: 7
Solution:
The maximum number of comparisons needed is log2(16) = 4, but since we start counting from 0, it takes 5 comparisons.