Question: Let T[1..n] be a sorted array of distinct integers, some of which may be negative. Design an algorithm that can find an index i such
![Let T[1..n] be a sorted array of distinct integers, some of](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66e06065a3167_77366e0606544e7d.jpg)
Let T[1..n] be a sorted array of distinct integers, some of which may be negative. Design an algorithm that can find an index i such that 1in and T[i]=i, if such an index exists, else returns 1. Design your algorithm such that its worst case efficiency is O(logn), and prove this result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
