GATE DA 2026 — Question 31

Programming, Data Structures and AlgorithmsSearch algorithms: linear search and binary searchNAT1 markMedium

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)
Practise the full 2026 paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Search algorithms: linear search and binary searchTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group