Given an array of dimension n, discover a peak aspect within the array.
In Array [1,4,3,6,7,5] four and seven are Peak Components. Return anyone Peak Ingredient.
1: Initialize begin = 0, finish = array.size – 1
2: Repeat following steps until peak aspect is discovered:
(a) Discover mid = (begin+finish)/2
(b) If mid is peak aspect, return array[mid]
(c) If array[mid-1] is bigger than array[mid], discover peak in left half of array set finish = mid – 1
(d) Else discover peak in proper half of array set begin = mid + 1