/* 解题思路: 翻转每一棵树的左右子树根节点 */
void swap (struct TreeNode**x,struct TreeNode**y)
{
struct TreeNode*num=0;
num=*x;
*x=*y;
*y=num;
}
struct TreeNode* invertTree(struct TreeNode* root)
{
if(root==NULL)
{
return root;
}
if(root->right==NULL&&root->left==NULL)\
{
return root;
}
swap(&(root->right),&(root->left));
invertTree(root->right);
invertTree(root->left);
return root;
}
?