GATE CS 2017 (Forenoon) — Question 48

AlgorithmsSearching, Sorting, Hashing MechanismsNAT2 marksMedium

Let \(A\) be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index \(i\) such that \(A[i]\) is 1 by probing the minimum number of locations in \(A\). The worst case number of probes performed by an optimal algorithm is ________.
Practise the full 2017-FN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Searching, Sorting, Hashing MechanismsTimed, 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