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

来源:互联网 发布:淘宝的销量多久清零 编辑:程序博客网 时间:2024/06/06 07:32
def MirroRecursively(root):# root is None or just one node, return rootif None == root or None == root.left and None == root.right:return rootroot.left, root.right = root.right, root.leftMirroRecursively(root.left)MirroRecursively(root.right)return root 

0 0