0 0 votes given a sorted array of distinct integers A[1........n], you want to find out whether there is an index i for which A[i]=i.if this problem is solved using divide and conquer method ,then the algorithm run in a) O(n) a) O(nlogn) a) O(logn) a) O(n2) Algorithms divide-and-conquer sorting time-complexity + – ajit 1.2k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 1 1 vote Ans- 0(logn) Algorithm int special_search(int a[],int l,int r) { int mid; if(l<r) { mid=l+(r-l)/2; if(a[mid]==mid) return mid; else if(a[mid]>mid) return special_search(a,l,mid-1); else return(a,mid+1,r) } } Saurav answered Sep 7, 2015 Saurav comment Share Follow 0 reply Please log in or register to add a comment.