Question: 1. (2 points) Draw all possible binary trees containing 3 nodes. 2. (8 points) Suppose Tree Type variable t has the following value 35 15

 1. (2 points) Draw all possible binary trees containing 3 nodes.
2. (8 points) Suppose Tree Type variable t has the following value

1. (2 points) Draw all possible binary trees containing 3 nodes. 2. (8 points) Suppose Tree Type variable t has the following value 35 15 40 38 42 (a) Draw the tree that results after executing (all of the following operations: t.Put Item (25) t.PutItem (12) t.PutItem (30) t.Deleteltem (38) t Deleteltem (5); t.Deleteltem (35) (b) Give the order the nodes of the resulting tree from part (a) are visited when the tree is traversed by in-order, pre-order, and post-order scans 3. (4 points) Write a TreeType member function Sum that returns the sum of the items in its tree Assume that a default constructor and operator+ is defined for the item type ItemType. Ifthe tree is empty, return the default constructed ItemType item. To call a default constructor without declaring a variable, just give the name of the default constructor with no arguments. E.g. return ItemType You should write a recursive helper function to do this

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 Databases Questions!