CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Let A be an array of 31 numbers consisting of a sequence of O's followed by a sequence of I'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 ____

  1. 5

Join BYJU'S Learning Program
CrossIcon