Language: C++ Use this code Node.hPreview the documentView in a new window, BSTr
ID: 3805243 • Letter: L
Question
Language: C++
Use this code Node.hPreview the documentView in a new window, BSTree.hPreview the documentView in a new window, BSTree.cppView in a new window to implement a binary search tree. Specifically, you will implement a printPreorder, printInorder, printPostorder, and findNode member functions. Do not make other changes to the Node.h or the BSTree.h. Ensure that you document any changes that you make in BSTree.cpp with your name at the top. We left the member function headers in the code, so you just need to fill in the code.
Demonstrate that you did this correctly by building a main program that uses these functions to build an output that looks very similar to HW08 Output.pngView in a new window. If you modified these on a Windows System, make sure to move to the csegrid and run dos2unix, before zipping and submitting to canvas. Make sure that you have a working/tested makefile and readme.txt file.
Node.h
----------------------------------------------------------------------------------------------------------------------------------------
BSTree.h
BSTree.cpp
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) { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.