# 1 题目描述

Invert a binary tree.

     4
/   \
2     7
/ \   / \
1   3 6   9
to
     4
/   \
7     2
/ \   / \
9   6 3   1

# 3 源代码

package com.larry.easy;

import com.larry.util.TreeNode;

public class InvertBinaryTree {
public void inOrder(TreeNode root){
if(root == null) return;
TreeNode tempNode = root.left;
root.left = root.right;
root.right = tempNode;
inOrder(root.left);
inOrder(root.right);
}

public TreeNode invertTree(TreeNode root) {
inOrder(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