Dequeue all Nodes of current level and Enqueue all Nodes of next level
vector < int > curr_level1 , curr_level2 ; while ( n1 > 0 ) { Node * node1 = q1 . front ( ) ; q1 . pop ( ) ; if ( node1 -> left != NULL ) q1 . push ( node1 -> left ) ; if ( node1 -> right != NULL ) q1 . push ( node1 -> right ) ; n1 -- ; Node * node2 = q2 . front ( ) ; q2 . pop ( ) ; if ( node2 -> left != NULL ) q2 . push ( node2 -> left ) ; if ( node2 -> right != NULL ) q2 . push ( node2 -> right ) ; curr_level1 . push_back ( node1 -> data ) ; curr_level2 . push_back ( node2 -> data ) ; }