For printing nodes from right to left , push the nodes to stack instead of printing them .
else { if ( temp . right != null ) Q . add ( temp . right ) ; if ( temp . left != null ) Q . add ( temp . left ) ; } } System . out . println ( ) ;