Function to print the level order traversal of the Binary tree
function print ( root ) { var Q = [ ] Q . push ( root ) ; while ( Q . length > 0 ) { var temp = Q [ 0 ] ; Q . shift ( ) ; document . write ( temp . data ) ; if ( temp . left != null ) Q . push ( temp . left ) ; if ( temp . right != null ) Q . push ( temp . right ) ; } }