class Solution { public: TreeNode* invertTree(TreeNode* root) { if(root == NULL) return NULL; TreeNode* tmp = invertTree(root->left); root->left = invertTree(root->right); root->right = tmp; return root; } };