Suppose there is a tree:
1 / \\ 2 3 / \\ 4 5
Then the mirror image will
void mirror(node *& root2,node * root) { if(root==NULL) { root2=NULL; } else { root2=new node; root2->data=root->data; root2->left=NULL; root2->right=NULL; mirror(root2->left,root->right); mirror(root2->right,root->left); } }