typedef char DataType
typedef struct TNode
{
DataType value;
struct TNode* leftchild;
struct TNode* rightchild;
}TreeNode;
//二叉树的镜像
void MirrorRecursively(TreeNode* tree)
{
if(tree==NULL)
{
return;
}
if(tree->leftchild==NULL && tree->rightchild==NULL)
{
return;
}
TreeNode temp = tree->leftchild;
tree->leftchild = tree->rightchild;
tree->rightchild = temp;
if(tree->leftchild!=NULL)
{
MirrorRecursively(tree->leftchild);
}
if(tree->rightchild!=NULL)
{
MirrorRecursively(tree->rightchild);
}
}