Finding a Peak Element in an Array with Binary Search

When working with arrays, a common problem is finding a peak element. A peak element is defined as an element that is greater than its…