The 1st and foremost condition of Binary Search is that the array must be sorted. Binary search is used to find a specific number, if you want to find the maximum number only then sort the array in descending order and print the value of 0th index.

If you don't want the array to be sorted you should go for sequential search instead.