Question: (20 points) An array A[1.n], has the following property: It first increases upto some point and then starts decreasing after this point. So for some
(20 points) An array A[1.n], has the following property: It first increases upto some point and then starts decreasing after this point. So for some number i,A[j]A[j+1] for all ji. This means that A[i] is the maximum entry in the array. But we don't know this number i. The problem is to find this maximum entry. Give an algorithm for this task which takes O(logn) time. Explain it in english as well as write a pseudocode. Give its analysis in terms of big-O complexity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
