Filter by year

Binary Search questions

Q31

GATE DA 2026 DASearching and SortingNAT1 mark

Report a problem with Q31

What is wrong?
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)
Show answer without attempting

Loading the answer…

0/10 correct0 marks

Related topics in Searching and Sorting