To store the node and the label and perform traversal
queue < pair < Node * , int > > qt ; qt . push ( make_pair ( root , 0 ) ) ; int count = 1 , b , a = 0 ; while ( ! qt . empty ( ) ) { pair < Node * , int > temp = qt . front ( ) ; qt . pop ( ) ;