(root *TreeNode)
| 3 | import . "github.com/austingebauer/go-leetcode/structures" |
| 4 | |
| 5 | func invertTree(root *TreeNode) *TreeNode { |
| 6 | if root == nil { |
| 7 | return nil |
| 8 | } |
| 9 | |
| 10 | root.Left, root.Right = invertTree(root.Right), invertTree(root.Left) |
| 11 | return root |
| 12 | } |
no outgoing calls