Computer Sciences > Gate 2017 Set-1 > Array
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________.

Correct : a

Similar Questions

Consider the following array of elements. 〈89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100〉. The minimum number of interchanges needed to convert it int...
#31 MCQ
Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons required to find the maximum in the heap is _...
#638 Fill in the Blanks
Consider the following C program. #include <stdio.h> int main () {     int a[4][5] = {{1, 2, 3, 4, 5},       {6, 7, 8, 9, 10...
#648 Fill in the Blanks

Related Topics

binary search array problem GATE computer science 2017 binary search algorithm find first 1 in sorted array minimum probes optimal algorithm binary search sorted array binary search binary search question gate

Unique Visitor Count

Total Unique Visitors

Loading......