Question: You are given a sorted array A[1 .. n] of keys, and another key x which is stored somewhere in A. Show how to find
You are given a sorted array A[1 .. n] of keys, and another key x which is stored somewhere in A. Show how to find the index k so that A[k] = x in time O(1+ log k). (Note k is not given, and can be much smaller than n). (b) Same, but now find k in time O(1 + log(min{k, n - k})
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
