For printing nodes from right to left , push the nodes to stack instead of printing them .
else myStack . push ( temp ) ; if ( temp . left != null ) myQueue . push ( temp . left ) ; if ( temp . right != null ) myQueue . push ( temp . right ) ; } if ( rightToLeft == true ) {