Programming Assignment BST
Programming Assignment BST
1. Download the source programs for Binary Search Tree (BST.cpp, BST.h, and Sam-
ple_BST_tester.cpp) from iLearn.
(b) Add a new member function called inOrder() that implements the inorder traversal algorithm
of a binary search tree. Your function should display each node data on the screen.
void BST::inOrder()
(c) Add a new member function called preOrder() that implements the preorder traversal algo-
rithm of a binary search tree. Your function should display each node data on the screen.
void BST::preOrder()
(d) Add a new member function called nodeCount() to count the number of nodes in a binary
search tree. In this function, you should use a recursive function. You can’t just use a variable
such as “mySize”.
int BST::nodeCount()
Grading
I will download your code on my computer and execute it. If your code does not compile, you may
lose more than 50% of your points (based on my discretion). If your code compiles, but still produces
incorrect results you may still lose more than 30% of your points (based on my discretion).
Your code should have the following characteristics for you to get full points on the assignment
Page 1 of 2
What to turn in?
Submit your source programs and ‘ProgramSubmission_yourlastname.pdf’ as a single zipped file
‘Program6_yourfullname’ on iLearn. For the program, please include only the source files needed to
compile and run successfully.
If you do not submit the above mentioned documents in the format specified your assignment
will not be graded.
Program Submission_yourlastname.pdf
For each program assignment, you are expected to submit screenshots of the results obtained from
running your code. You should also explain what each screenshot means and why the result on the
screenshot is correct.
Page 2 of 2