Sequential binary tree based on sum

mirais2

New member
Joined
Dec 5, 2012
Messages
2
Hello.

I have an exercise about a binary tree that, after several frustrated days and vain attempts, I'm not able to understand.

The problem simply is:

Given the following binary tree:

binTree.jpg

where the left node is the previous node plus one (y = x + 1) and the right node is the previous node plus two (y = x + 2), is it possible to reconstruct the binary tree having only the last number?
For example, how to differentiate:

2
/ \
3 4

from:

3
/ \
4 5

or to differentiate:


9
/ \
10 11

from:

10
/ \
11 12


Very thanks.
 
Not sure I understand the question ...

When you say 'is it possible to reconstruct the binary tree having only the last number?'
does that mean the whole tree is there and the highest number is known?
because in that case it would be only possible with even numbers?

 
Not sure I understand the question ...

When you say 'is it possible to reconstruct the binary tree having only the last number?'
does that mean the whole tree is there and the highest number is known?
because in that case it would be only possible with even numbers?


Thanks for the reply, phoenix9124.

Say I have only this branch of the tree:

binTree2.jpg

Is it possible, somehow, to reconstruct the tree only with that and form the following? =>
(Say this is the original tree from which the branch come from.)

binTree3.jpg

But the problem is that there are so many possibilities with this same branch, for instance:

binTree4.jpg
 
I've never heard of a sequential binary tree before this post, so I'm not really much help, but..

The way i see the question is that if the highest number is known, which would be a 6 in the very first attachment, then i guess it is possible to reconstruct the whole tree (unless it is an un-even number, that would destroy this theory. Since then it cannot be the highest number.)

However, I don't know if the tree has any limitations, like if it can suddenly stop somewhere in the middle.

I hope someone else can provide you with more help :D.
 
. is it possible to reconstruct the binary tree having only the last number?
I take the "last number" to be the number furthest to the right, in this case, 6.
You can then add nodes up to the left by subtracting 2 - but how do you know when to stop?
Seems to me you need one more piece of information - so I would say it is not possible.
 
Top