Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged.
Read full article from Write an Efficient C Function to Convert a Binary Tree into its Mirror Tree | GeeksforGeeks
void
mirror(
struct
node* node)
{
if
(node==NULL)
return
;
else
{
struct
node* temp;
/* do the subtrees */
mirror(node->left);
mirror(node->right);
/* swap the pointers in this node */
temp = node->left;
node->left = node->right;
node->right = temp;
}
}