If previous value exceeds current value , return false
if pre . val > temp . val : NEW_LINE INDENT return False NEW_LINE DEDENT pre = temp NEW_LINE if temp . left : NEW_LINE INDENT que . append ( temp . left ) NEW_LINE DEDENT if temp . right : NEW_LINE INDENT que . append ( temp . right ) NEW_LINE DEDENT length -= 1 NEW_LINE return True NEW_LINE