Traverse further only if there are at - least two nodes left
while ( temp != None and temp . next != None ) : NEW_LINE INDENT if ( temp . data > temp . next . data ) : NEW_LINE INDENT flag = False NEW_LINE break NEW_LINE DEDENT temp = temp . next . next NEW_LINE DEDENT return flag NEW_LINE