反转二叉树
很简单的递归 直接冲
class Solution:
def invertTree(self, root):
def swap(node):
if node == None:
return
node.right, node.left = node.left, node.right
swap(node.left)
swap(node.right)
swap(root)
return root