当前位置: 移动技术网 > IT编程>开发语言>.net > 代码面试集锦 2 - Google

代码面试集锦 2 - Google

2019年02月11日  | 移动技术网IT编程  | 我要评论

朱小媚,4399拼图宝藏屋,灌篮高手mp4下载

given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.

for example, given the following node class

class node:
    def __init__(self, val, left=none, right=none):
        self.val = val
        self.left = left
        self.right = right

the following test should pass:

node = node('root', node('left', node('left.left')), node('right'))
assert deserialize(serialize(node)).left.left.val == 'left.left'

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网