GATE DA 2026 · Question 31 · Programming, Data Structures and Algorithms · Numerical answer (NAT) · 1 mark · no negative marks
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 )
Answer
Answer 10
Answer from the official GATE DA 2026 answer key.
The step-by-step solution, where available, is part of GATE DA Pro. See what Pro includes