Sir need help for concept

sir for question find peak element array is not sorted so how we can think of applying binary search
code: https://ide.codingblocks.com/s/212448

what is the problem statement? is it to find the max element in the array?

binary search is used to find an element only when array is sorted.
if array is not sorted, we can only use linear search to find the element.

so apply linear search to find max element in the array.
if this is not what you want to ask, please elaborate your question?

thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.