Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Study the three Java source files. Create a project in eclipse to run the code a

ID: 3834408 • Letter: S

Question

Study the three Java source files.

Create a project in eclipse to run the code and run it to see the output.

Then, modify the code in BinaryTreeNodes.java according to the following:

build a binary tree as the values are read from NodeVals.txt

print the inorder traversal of the tree using the routine in NodeUtilities.java

the internal order of the tree is represented by the diagram in the "Binary Tree.doc" file.

Note:

don't create variable names for each node so the program will work with varying input sizes (contrary to the sample file where the values are hard coded);

create a variable to hold the root node, and, a variable to address the node being visited/worked on.

Explanation / Answer

# include # include using namespace std; /* * Node Declaration */ struct node { int info; struct node *left; struct node *right; }*root; /* * Class Declaration */ class BST { public: void find(int, node **, node **); void insert(int); void del(int); void case_a(node *,node *); void case_b(node *,node *); void case_c(node *,node *); void preorder(node *); void inorder(node *); void postorder(node *); void display(node *, int); BST() { root = NULL; } }; /* * Main Contains Menu */ int main() { int choice, num; BST bst; node *temp; while (1) { cout