diff --git a/problems/0226.翻转二叉树.md b/problems/0226.翻转二叉树.md index afc1f144..ec1335c6 100644 --- a/problems/0226.翻转二叉树.md +++ b/problems/0226.翻转二叉树.md @@ -208,8 +208,21 @@ Java: Python: -Go: +```Go +func invertTree(root *TreeNode) *TreeNode { + if root ==nil{ + return nil + } + temp:=root.Left + root.Left=root.Right + root.Right=temp + + invertTree(root.Left) + invertTree(root.Right) + return root +} +```