首页 > 代码库 > 【剑指offer】Q19:二叉树的镜像

【剑指offer】Q19:二叉树的镜像

def MirroRecursively(root):
	# root is None or just one node, return root
	if None == root or None == root.left and None == root.right:
		return root
	root.left, root.right = root.right, root.left
	MirroRecursively(root.left)
	MirroRecursively(root.right)
	return root