/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
struct TreeNode* invertTree(struct TreeNode* root)
{
if(NULL == root)
return NULL;
struct TreeNode* tmp = root->left;
root->left = invertTree(root->right);
/*root->left改变,tmp保存root->left原有的值*/
root->right = invertTree(tmp);
return root;
}