for printing the nodes in order from right to left
while ( Q . Count != 0 ) { temp = Q . Peek ( ) ; Q . Dequeue ( ) ; Console . Write ( temp . data + " ▁ " ) ; if ( dir == LEFT ) { if ( temp . left != null ) S . Push ( temp . left ) ; if ( temp . right != null ) S . Push ( temp . right ) ; } else { if ( temp . right != null ) S . Push ( temp . right ) ; if ( temp . left != null ) S . Push ( temp . left ) ; } } Console . WriteLine ( ) ;