Function to perform binary search in an a subarray if elements of the subarray are in an ascending order
def reverseBS ( X , left , right , arr ) : NEW_LINE INDENT while ( left <= right ) : NEW_LINE DEDENT