Let \(A\) be an array of 31 numbers consisting of a sequence of 0's followed…

PYQ GATE 2017

Let AA 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 ii such that A[i]A[i] is 1 by probing the minimum number of locations in AA. The worst case number of probes performed by an optimal algorithm is ____________.

Attempted by 128 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…