Use the queue data structure for level order insertion and push the root of tree to Queue
queue < node * > Q ; Q . push ( root ) ; while ( ! Q . empty ( ) ) { node * temp = Q . front ( ) ; Q . pop ( ) ;