Iterate until queue is empty
while ( length ) { auto temp = que . front ( ) ; que . pop ( ) ; cout << temp -> val << " ▁ " ; if ( temp -> left ) que . push ( temp -> left ) ; if ( temp -> right ) que . push ( temp -> right ) ; length -= 1 ; } cout << endl ; } cout << endl ; }