Question: Write efficient functions that take only a pointer to the root of a binary search tree, T, and compute: The number of nodes in T.

Write efficient functions that take only a pointer to the root of a binary search tree, T, and compute: The number of nodes in T. The number of leaves in T. The number of full nodes (a full node is a node with two children) in T. Your main program reads a set of values from Data In file into the tree, then call the above functions to compute. The main program should print out the answer of each function (a#, b#, c#) as follows, see sample data input/output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
