Talk is cheap.
func mirror(root *TreeNode) *TreeNode { if root == nil { return root } root.Left, root.Right = mirror(root.Right), mirror(root.Left) return root }