GATEverse Practice, past papers & mock tests
GATE 2026 · session-8
Programming, Data Structures and AlgorithmsBinary SearchmediumNAT1 mark
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)
Save your progress

Related Programming, Data Structures and Algorithms PYQs