Question: In this assignment, you are going to implement some functions for a tree data structure. You must use the given tree implementation. You can use

 In this assignment, you are going to implement some functions for
a tree data structure. You must use the given tree implementation. You
can use it to test your functions. Do your own work to
stay away from punishment. Below are functions that you need to implement

In this assignment, you are going to implement some functions for a tree data structure. You must use the given tree implementation. You can use it to test your functions. Do your own work to stay away from punishment. Below are functions that you need to implement in this assignment, you can also soe the expected outputs in the comments for the given tree above. Do not change the function names: int height (TreeNodest>* node): // 30 points 1. This function finds the height of a given tree. The height of given tree in the figure is 5 . % vector findonlychilds (zreeNodect>" treeNode); 4170 points 1. This function returns the nodes that do have not any siblings. The only children in the given figure are 8,17 and 27% Tree tree; tree.insert(9); tree.insert(7); tree.insert(12); tree.insert(8); tree.insert (10); tree.insert(15); tree.insert (17); tree.insert(27); cout tree. height (tree.root)

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!