Question: For this program you will create a binary tree in main as follows: BST Binary_Tree_of_Ints; Binary_Tree_of_Ints.insert (13); Binary_Tree_of_Ints.insert (10); Binary_Tree_of_Ints.insert (2); Binary_Tree_of_Ints.insert (12); Binary Tree_of_Ints.insert

 For this program you will create a binary tree in mainas follows: BST Binary_Tree_of_Ints; Binary_Tree_of_Ints.insert (13); Binary_Tree_of_Ints.insert (10); Binary_Tree_of_Ints.insert (2); Binary_Tree_of_Ints.insert (12);

For this program you will create a binary tree in main as follows: BST Binary_Tree_of_Ints; Binary_Tree_of_Ints.insert (13); Binary_Tree_of_Ints.insert (10); Binary_Tree_of_Ints.insert (2); Binary_Tree_of_Ints.insert (12); Binary Tree_of_Ints.insert (25) Binary_Tree_of_Ints.insert(20); Binary_Tree_of_Ints.insert (31); Binary_Tree_of_Ints.insert (29); using the binary tree code posted on the website. You should recognize this tree as the same one used in several examples in the slides Then you will create a new member function called CollectStatistics, that returns the number of levels in the tree, and takes in three arguments, an array of integers for holding the number of nodes at each level of the tree, and two integers passed in by reference to count the number of leaves of the tree and the number of interior (non-leaf) nodes of the tree The girth of a tree is defined to be the maximum number of nodes at any level of the tree This member function MUST be implemented non-recursively using a queue. You need to determine how to do this. For displaying the contents of the tree, you should use the appropriate prewritten traversal function The output of the program should be This is a program to display statistics for a binary tree The contents of the tree in ascending order are: 2 10 12 13 20 25 29 31 The height of the tree is: 4 The girth of the tree is: 4 The number of nodes in each level is: The number of interior nodes is: 4 The number of leaf nodes is: 4 The total number of nodes is: 8

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!