Two different binary trees can have same set of Leaves/Inner Nodes and same
Preorder traversal
5
/ \
3 10
/ \
1 9
\
7
5
/ \
3 9
/ / \
1 7 10
So, I guess it is not solvable unless we have some more information.
Thanks,
Balaji.
On Fri, Jan 14, 2011 at 10:50 AM, Decipher <[email protected]> wrote:
> A special type of tree is given, where all leaf are marked with L and
> others are marked with N. every node can have 0 or at most 2 nodes. Trees
> preorder traversal is given give a algorithm to build tree from this
> traversal.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.