# Invert Binary Tree

/**
* Definition for a binary tree node.
* struct TreeNode {
*     int val;
*     TreeNode *left;
*     TreeNode *right;
*     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void invert(TreeNode *root) {
if(root == NULL)
return;

TreeNode *leftNode, *rightNode;
leftNode = root->left;
rightNode = root->right;
root->left = rightNode;
root->right = leftNode;
invert(root->left);
invert(root->right);
}
TreeNode* invertTree(TreeNode* root) {
invert(root);
return root;

}
};

#### 226. Invert Binary Tree [easy] (Python)

2016-05-12 14:36:34

#### 【LeetCode】226. Invert Binary Tree 解题报告

2016-05-29 00:18:13

#### leetcode 226 Invert Binary Tree 翻转二叉树

2015-06-23 23:53:58

#### Leetcode 226: Invert Binary Tree(二叉树反转 递归、非递归实现)

2015-06-13 14:41:43

#### PAT_A 1102. Invert a Binary Tree (25)

2016-10-23 10:19:12

#### C#版 - 226. Invert Binary Tree(剑指offer 面试题19) - 题解

2018-06-10 15:56:23

#### 1102 Invert a Binary Tree

2016-02-25 16:49:43

#### Invert Binary Tree 递归

2016-05-15 16:45:56

#### Lintcode175 Invert Binary Tree solution 题解

2017-12-11 18:43:43

#### 1102. Invert a Binary Tree (25)【二叉树】——PAT (Advanced Level) Practise

2016-05-14 20:46:38