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