Q31Section DA (Data Science and Artificial Intelligence (Q11–Q65))31 of 65
Worst-case comparisons for an unsuccessful ternary-outcome binary search
Let A be a sorted array containing 1000 distinct integers. You perform a recursive binary search on A to find an element y. Suppose each comparison checks whether the middle element computed during the current recursive step is equal to, less than, or greater than y. The maximum number of comparisons that may have to be performed if y is not an element of A is _______ . (Answer in integer)
Numerical answer: type the number (no options).
Type your answer and check it.