We assume that sequence is bitonic . We go to right subarray if middle point is part of increasing subsequence . Else we go to left subarray .
if ( $ arr [ $ mid ] < $ arr [ $ mid + 1 ] ) return binarySearch ( $ arr , $ mid + 1 , $ right ) ; else return binarySearch ( $ arr , $ left , $ mid - 1 ) ; } return -1 ; }