Skip to content

Commit fdb3a11

Browse files
committed
fix pullrequests/invert_binary_tree
1 parent 99ea196 commit fdb3a11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//lint:file-ignore U1000 Ignore all unused code
2+
package invertbinarytree
3+
4+
func invertTreeRecursive(root *TreeNode) *TreeNode {
5+
if root == nil {
6+
return nil
7+
}
8+
root.Left, root.Right = invertTreeRecursive(root.Right), invertTreeRecursive(root.Left)
9+
return root
10+
}

0 commit comments

Comments
 (0)