Question: Given a sorted array of distinct integers A[1...n], we want to find out whether there is an index i for which A[i] = i. Give
Given a sorted array of distinct integers A[1...n], we want to find out whether there is an index i for which A[i] = i. Give a divide-and-conquer algorithm that runs in time O(log n). (Hint: use the divide-and-conquer approach as in the binary search algorithm)
Step by Step Solution
3.53 Rating (156 Votes )
There are 3 Steps involved in it
To solve this problem we can use a divideandconquer approach similar to the binary search algorithm ... View full answer
Get step-by-step solutions from verified subject matter experts
