liugan 2020-01-01
class Solution: def Serialize(self, root): # write code here retList = [] def preOrder(root): if root == None: retList.append("#") return retList.append(str(root.val)) preOrder(root.left) preOrder(root.right) preOrder(root) return ‘ ‘.join(retList) def Deserialize(self, s): # write code here retList = s.split() def dePreOrder(): if retList == []: return None rootVal = retList[0] del retList[0] if rootVal == "#": return None node = TreeNode(int(rootVal)) leftNode = dePreOrder() rightNode = dePreOrder() node.left = leftNode node.right = rightNode return node pRoot = dePreOrder() return pRoot
2020-01-01 19:34:24
spring-data-redis RedisTemplate 操作redis时发现存储在redis中的key不是设置的string值,前面还多出了许多类似\xac\xed\x00\x05t\x00;