Tuesday, June 21, 2011

Serialize binary tree

We have a tree  where leaves are represented with ‘L’ and non-leaf with ‘N’. Each node has either 0 or 2 children. If given preorder traversal of this tree, construct the tree.

Can you use this as basis for serializing a generic tree?

No comments:

Post a Comment