Using binary search to get the peak element