递归解法:
(1)如果二叉树为空,返回空
(2)如果二叉树不为空,求左子树和右子树的镜像,然后交换左子树和右子树
BinaryTreeNode *Mirror(BinaryTreeNode *pRoot)
{
if (pRoot == NULL)
return NULL;
BinaryTreeNode *pLeft = Mirror(pRoot->lchild); // 求左子树的镜像
BinaryTreeNode *pRight = Mirror(pRoot->rchild); // 求右子树的镜像
pRoot->lchild = pRight;
pRoot->rchild = pLeft;
return pRoot;
}