Question: Urgent C++ help!! Please design and code the following program: Using the IntBinaryTree class, add the following member functions: Leaf Counter (which counts and returns

Urgent C++ help!!

Please design and code the following program:

Using the IntBinaryTree class, add the following member functions:

Leaf Counter (which counts and returns the number of leaf nodes in the tree)

Tree Height (which counts and returns the height of the tree - the height is the number of levels it contains)

Tree Width (which counts and returns the width of the tree - the width is the largest number of nodes in the same level.)

Write a simple menu-driven program that will allow the user to:

1. Insert numbers (validate for numeric)

2. Display the tree (in order)

3. Display Leaf Count

4. Display Tree Height

5. Display Tree Width

Thank you!!

Test the program as follows:

Insert the following numbers (one at a time through menu option 1): 10, 87, 9, 55, 13, 40, 22,1,0,77, 0, 4, 55, 33, 22

Display the tree

Display the leaf count

Display the tree height

Display the tree width

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!