break the loop if level exceeds the given level number
if ( level > klevel ) break ; } else { if ( temp . left != null ) q . push ( temp . left ) ; if ( temp . right != null ) q . push ( temp . right ) ; } } document . write ( " " ) ; return flag ; }