Suppose there is a tree:
1
/ \\
2 3
/ \\
4 5
Then the mirror image will
Sounds like homework.
It looks very easy. Write a recursive routine that depth-first visits every node and builds the mirror tree with left and right reversed.
struct node *mirror(struct node *here) {
if (here == NULL)
return NULL;
else {
struct node *newNode = malloc (sizeof(struct node));
newNode->value = here->value;
newNode->left = mirror(here->right);
newNode->right = mirror(here->left);
return newNode;
}
}
This returns a new tree - some other answers do this in place. Depends on what your assignment asked you to do :)