You have given an array in which numbers are first increasing and then decreasing. Find the maximum element in O(log n).
An integer array with unique elements has the following property – elements initially are in increasing order till a point after which they start to decrease. Implement a function to find the index of the maximum element in the array in less than linear time, i.e., O(n). Example: Input: array = {1, 3, 5, 7, 9, 8, 6, 4} Output: max index = 4 Max Index : 4. Max Element value is : 9