Suppose there is a tree:
1 / \\ 2 3 / \\ 4 5
Then the mirror image will
void swap_node(node n) { if(n != null) { node tmp = n.left; n.left = n.right; n.right = tmp; swap_node(n.left); swap_node(n.right); } } swap_node(root);