Page 1 of 1

Using the classes and methods implemented in Lab 7 do the following: Add the following methods to class BSTree: preOder(

Posted: Tue May 24, 2022 8:38 am
by answerhappygod
Using the classes and methods implemented in Lab 7 do the
following:
Add the following methods to class BSTree:
preOder()
preOrderRec(root)
Traverses and prints the contents of the tree pre-order according
to the ID.
postOder() postOrderRec(root)
Traverses and prints the contents of the tree post-order
according to the ID.
height() heightRec (root)
Returns the height of the tree.
countLeafNodes() countLeafNodesRec (root)
Returns the number of leaf nodes in the tree.
Write the expected time and space complexity as a comment at the
beginning of each method of your class.
Modify the test program form lab 7 to do the following:
Sample Output
The program can perform the following:
1- Insert Students
2- Remove a Student
3- Check if a Student Exists
4- Print inOrder
5- Print preOrder
6- Print postOrder
7- Height
8- Number of leaf nodes
9- Exit Please enter your selection:
LAB 7 CODE IS SHOWN BELOW (Please
modify!!):