Question: 3. (a) You are given a sorted array A[1...n] of keys, and another key r which is stored somewhere in A. Show how to find
![3. (a) You are given a sorted array A[1...n] of keys,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39a4958fd0_77666f39a48e576b.jpg)
3. (a) You are given a sorted array A[1...n] of keys, and another key r which is stored somewhere in A. Show how to find the index k so that A[k] = x in time 0(1+log k). (Note k is not given, and can be much smaller than n). (b) Same, but now find k in time 0(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
