To check if the elements to the left of the pivot are in descending or not
if ( l < pivot ) : NEW_LINE INDENT while ( pivot > l ) : NEW_LINE INDENT if ( arr [ pivot ] < arr [ pivot - 1 ] ) : NEW_LINE INDENT return False ; NEW_LINE DEDENT pivot -= 1 ; NEW_LINE DEDENT DEDENT