a. Print out the tree in inorder.
b. Print out the tree in preorder.
c. Print out the tree in postorder.
d. Print out the number of nodes in the tree. (Traverse the tree and count the nodes.)
e. Sum up all the values in the tree and compute the average.
f. Count the number of leaves in the tree.
g. Print the value that is the deepest in the tree.
Input file is named as "TreeData.dat".
I am stuck on this binary tree program. I have attached my code and data file.
Please find attached 535630.cpp that shows how recursion can be used to implement almost every function used in the code to accomplish the given tasks. If you notice carefully, you will see that many of these functions are ...
Solution shows how recursion can be used to accomplish the given tasks. Recursion makes it easy to understand what is going on, apart from neat looking and compact code.