Iterates untill queue become empty
while ( ! q . isEmpty ( ) ) { tmp = q . poll ( ) ; if ( tmp . left != null ) q . offer ( tmp . left ) ; if ( tmp . right != null ) q . offer ( tmp . right ) ; } return tmp ; }