实现两个函数,分别用来序列化和反序列化二叉树 #-*- coding:utf-8 -*- class TreeNode: def __init__(self,x): self.val = x self.left=None self.right =None class Solution: def Serialize(self,root): retList=[] def preOrder(root): if root==None: retList.