break the loop if level exceeds the given level number
if ( level > klevel ) : NEW_LINE INDENT break NEW_LINE DEDENT else : NEW_LINE if ( temp . left ) : NEW_LINE INDENT q . append ( temp . left ) NEW_LINE DEDENT if ( temp . right ) : NEW_LINE INDENT q . append ( temp . right ) NEW_LINE DEDENT print ( ) NEW_LINE return flag NEW_LINE