Write a recursive member function level for class template


Use the attached Binary Search Tree template (BST.h) for the following exercises.

1. Write a recursive member function level() for class template BST(Binary Search Tree) that determines the level in the BST at which a specified item is located. The root of the BST is at level 0, its children are at level 1, and so on.

2. Write a recursive member function leafCount() for class template BST to count the leaves in a binary tree.
[Hint: How is the number of leaves in the entire tree related to the number of leaves in the left and right subtrees of that root?]

Attachment:- BST.zip

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a recursive member function level for class template
Reference No:- TGS01247107

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)