Let A be an array of 31 numbers consisting of sequence of 0's followed by a sequence of 1's.
The problem is to find the smallest index i that A[i] is 1 by probing the minimum numbers of
locations in A. The worst case number of probes performed by an optimal algorithm is
.
GATE CS 2017 · Set-1 · Linear Search & Binary Search
Solve it on GATE DA practice →More Searching & Sorting Algorithms problems