今際の国の呵呵君
Thursday, September 13, 2018
[LeetCode]Serialize and Deserialize N-ary Tree
这道题我们套用我们
Serialize and Deserialize Binary Tree
的第一种序列化的方法,用(rootVal(subtree1)(subtree2)...(subtreeN))来表示即可。时间复杂度O(N),N为输入Tree的节点数。代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment