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 ] ) : NEW_LINE INDENT return binarySearch ( arr , mid + 1 , right ) ; NEW_LINE DEDENT else : NEW_LINE INDENT return binarySearch ( arr , left , mid - 1 ) ; NEW_LINE DEDENT return - 1 ; NEW_LINE