To store the node and the label and perform traversal
Queue qt = new Queue ( ) ; qt . Enqueue ( new pair ( root , 0 ) ) ; int count = 1 , b = 0 , a = 0 ; while ( qt . Count != 0 ) { pair temp = ( pair ) qt . Dequeue ( ) ;