Question: In this problem we are going to deal with a type of weighted binary tree in which each node contains one positive integer and has

In this problem we are going to deal with a type of weighted binary tree in which each node contains one positive integer and has either no sub-trees or exactly one left sub-tree and one right sub-tree. On the right is a sample weighted binary tree so that you see how to generate those in EATEEx. By definition, the weight of a binary tree is the sum of all of the integers contained in the nodes of the tree.
In this problem, we consider a special type of weigted binary tree called a balanced weighted binary tree or BWBT defined inductively as follows:
Basis: A single node containing a positive integer and with no sub-trees is a BWBT. This node is the root of the BWBT.
Inductive rule: If L and R are both BWBTs of equal weight w, then a new BWBT can be constructed by:
adding a new node n whose weight is a positive integer less than or equal to w,
adding an edge between n and the root of L, thereby making L the left sub-tree of the new tree, and
adding an edge between n and the root of R, thereby making R the right sub-tree of the new tree. n is the root of the new tree.
a.(8 points) This question asks you to count the number of distinct trees of a given weight win{1,2,3,cdots,15} and to write down your answer by completing the table below.
Write down your answer in the table below
\table[[weight of the BWBT,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[number of distinct BWBTs with this weight value,,,,,,,,,,,,,,,]]
b.(7 points) Draw all of the distinct BWBTs whose weight is equal to 14.
Draw your trees in this box.
[This problem is continued on the next page]
?1 The two rightmost trees are considered different because their roots do not have the same left-subtrees. Also, they do not have the same right sub-trees.
3
In this problem we are going to deal with a type of weighted binary tree in which each node contains one positive integer and has either no sub-trees or exactly one left sub-tree and one right sub-tree. On the right is a sample weighted binary tree so that you see how to generate those in EAFExx. By definition, the weight of a binary tree is the sum of all of the integers contained in the nodes of the tree.
In this problem, we consider a special type of weigted binary tree called a balanced weighted binary tree or BWBT defined inductively as follows:
Basis: A single node containing a positive integer and with no sub-trees is a BWBT. This node is the root of the BWBT.
Inductive rule: If L and R are both BWBTs of equal weight w, then a new BWBT can be constructed by:
adding a new node n whose weight is a positive integer less than or equal to w,
adding an edge between n and the root of L, thereby making L the left sub-tree of the new tree, and
adding an edge between n and the root of R, thereby making R the right sub-tree of the new tree. n is the root of the new tree.
a.(8 points) 'I'his question asks you to count the number of distinct trees of a given weight win{1,2,3,cdots,15} and to write down your answer by completing the table below.
Write down your answer in the table below
\table[[weight of the BWBT,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[number of distinct BWBTs with this weight value,,,,,,,,,,,,,,,]]
b.(7 points) Draw all of the distinct BWBTs whose weight is equal to 14.
Draw vour trees in this box.
[This problem is continued on the next page]
?1 The two rightmost trees are considered different because their roots do not have the same left-subtrees. Also, they do not have the same right sub-trees.
3
In this problem we are going to deal with a type

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!