操作給定的二叉樹,將其變換爲原二叉樹的鏡像。
class TreeNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def Mirror(self,root):
if root == None:
return None
root.left, root.right = root.right, root.left
self.Mirror(root.left)
self.Mirror(root.right)