Question: Suppose we have a black - box which is a program such that it can report either TRUE or FALSE with any input number x

Suppose we have a "black-box" which is a program such that it can report either TRUE or
FALSE with any input number x in constant time. Further, we have the following basic rules:
If the input x is reported TRUE by the "black-box", then any number larger than x must be
reported TRUE.
Given a sorted array A[1,dots,n] of n numbers, we want to find the smallest number in A
which is reported TRUE by the "black-box".
a) Design an O(logn) time algorithm for the problem. (20)
b) Suppose the "black-box" needs O(logn) time to report either TRUE or FALSE
instead of constant time, re-analyze the running time of your algorithm. (10)
 Suppose we have a "black-box" which is a program such that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!