【二叉树】二叉树的镜像

2019-08-14  本文已影响0人  一个想当大佬的菜鸡
class Solution:
    # 返回镜像树的根节点
    def Mirror(self, root):
        # write code here
        if root == None:
            return root
        temp = self.Mirror(root.right)
        root.right = self.Mirror(root.left)
        root.left = temp
        return root
上一篇下一篇

猜你喜欢

热点阅读