Change a tree so that the roles of the left and right pointers are swapped at every node . So the tree ... 4 / \ 2 5 / \ 1 3 is changed to ... 4 / \ 5 2 / \ 3 1
class GFG { public Node root ; public virtual void mirror ( ) { root = mirror ( root ) ; } public virtual Node mirror ( Node node ) { if ( node == null ) { return node ; }