Discussion Forum

Uniquely determined binary trees

Uniquely determined binary trees

av Robert Rekefors -
Antal svar: 5

When we have a preorder binary tree with 6 vertices, how can we determine if it's uniquely determined? Preoder means 1 root, two children of the root, left child has two children but right child only has a left child so what does that mean for uniquely determined? Even numbered vertices means one of the children only has one subchild so not everyone has 0 or 2 children. 

Som svar till Robert Rekefors

Re: Uniquely determined binary trees

av Patricia Alexandra Ebert -

Assuming the question is related to Ex 3. The question is if there exists a unique binary tree with 6 vertices whose preorder traversal is A B D E C F or can you find two (or even more) different binary trees with 6 vertices that both have A B D E C F as their preorder traversal. 

Note that a binary tree is defined as an ordered, rooted tree for which each vertex has at most two children. So, one child is okay. 

Som svar till Robert Rekefors

Re: Uniquely determined binary trees

av Kyle Aidan Tenn -
One thing to add, I guess ask, but also ask myself, is a binary tree one that can have a right child, or a left child? Must the tree always have the child to the left first? I think this clarifies it for me.
Som svar till Kyle Aidan Tenn

Re: Uniquely determined binary trees

av Patricia Alexandra Ebert -

As defined in the script: 

A binary tree is an ordered, rooted tree for which each vertex v has at most two children and, if v has only child, then there is a clear distinction as whether this child is right or left child. 

Hence, a vertex can have a right child but no left child. 

In a nearly-complete binary tree, this is not possible. 

Som svar till Patricia Alexandra Ebert

Sv: Re: Uniquely determined binary trees

av Robert Rekefors -
how can we design an algorithm that checks every weight for every object in a stack? Should only the weight be the parameter and should the parameter be the weight for the correct items or the weight for that specific object so that we get to know that the wrong coin is item x? I wonder how that algorithm should be designed.
Som svar till Robert Rekefors

Sv: Re: Uniquely determined binary trees

av Marc Hellmuth -
Note that Ex 3(6) does not require the use of stack. So I assume that this is a general topic you want to discuss with your colleagues and not with me or the TAs.
You could maybe open a new thread in the forum to invite colleagues to discuss this question.