标签:des style color ar for sp on bs amp
For a binary tree, preorder traversal may be enough.
For example,
_30_ / \ 10 20 / / \ 50 45 35The result is
30 10 50 # # # 20 45 # # 35 # #
Using a queue to deserialize it .
But a for multi-way tree, we could also use an array to serialize it, e.g.,
30 10 20 50 45 35
-1 0 0 1 2 2
Serialize a Binary Tree or a General Tree
标签:des style color ar for sp on bs amp
原文地址:http://blog.csdn.net/taoqick/article/details/40741433