Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions