c++ program most of it coded just need to get it working. please keep most of the logic the same

5/7/2021 HW39 https://loyno.instructure.com/courses/5769/assignments/160597?module_item_id=426778 1/3 HW39 5/7/2021 –/40 Points Calculated by: Most Recent Assignments (h ttp s://lo yn o.in str u ctu re .c o m /c o urs e s/5 769 /m odule s) Assignments (h ttp s://lo yn o.in str u ctu re .c o m /c o urs e s/5 769 /a ssig nm ents ) DetailsSimple Binary Tree repo: https://classroom.github.com/a/IeunEoRk ( h ttp s://c la ssro om .g it h ub.c o m /a /Ie u nE oR k) template file: T emplate_HW39.cpp ( h ttp s://lo yn o.in str u ctu re .c o m /c o urs es /5 769/f ile s/6 02262/p re vie w ) (h ttp s://lo yn o.in str u ctu re .c o m /c o urs es/5 769/f ile s/6 02262/d ow nlo ad ?dow nlo ad _fr d =1) points: 40 W rite a program to create and manipulate a simple binary tree. The binary tree should simple store integer values. Duplicate values can be ignored. Y ou must use pointers and a struct to store and manipulate each node.

Note: Fill out the code using the attached template. Download it to your repo and rename it for your assignment. I am giving you the structure of functions to use. All you have to do is fill in the missing areas! The book uses objects for this project, but the individual functions and algorithms are mostly the same.

Test your program with the given driver . You are to insert nodes, display the tree a few times, find some nodes, delete some nodes, display the tree, insert some nodes again, and finally display the tree again. I highly recommend not doing everything thing at once! Comment out some of the code and test things out as you code. It is okay to temporally pull a command out entirely , just be sure your final product has the full driver working. When you turn in your code, also answer the following:

1. What is the purpose of the function findParentNode? Why is the findNode not sufficient for this assignment? 2. Draw out (by hand or using ASCII art) the final version of the binary tree. This is after all insertions and deletions and insertions and such. (Hint: this is a very good thing to have handy while you are writing the program). 5/7/2021 HW39 https://loyno.instructure.com/courses/5769/assignments/160597?module_item_id=426778 2/3The output should look something like this: Binary Tree! Inserted node value of 21 Inserted node value of 38 Duplicate value found for 21. Node not inserted Inserted node value of 64 Inserted node value of 20 Inserted node value of 50 Duplicate value found for 21. Node not inserted Inserted node value of 55 Inserted node value of 63 Duplicate value found for 42. Node not inserted Inserted node value of 28 Inserted node value of 54 Inserted node value of 10 Inserted node value of 12 Inserted node value of 97 Displaying nodes in order: 10 12 20 21 28 38 42 50 54 55 63 64 97 Displaying nodes in PRE order: 42 21 20 10 12 38 28 64 50 55 54 63 97 Displaying nodes in POST order: 12 10 20 28 38 21 54 63 55 50 97 64 42 Node 22 NOT found! Node 20 WAS found! Attempting to delete node 52 Unable to find node 52 for deletion! Attempting to delete node 50 Deleting node 50 child on right side only Attempting to delete node 97 Deleting node 97 with no children Attempting to delete node 21 Deleting node 21 children on both sides Looking at node 38 Displaying nodes in order: 10 12 20 28 38 42 54 55 63 64 Inserted node value of 52 Inserted node value of 21 Inserted node value of 97 Displaying nodes in order: 10 12 20 21 28 38 42 52 54 55 63 64 97 Thank you!

You must use the repo from the link from each assignment to start and submit your work. You must include the standard header and comments in your source code for all of your files that you submit.

Compile, run, and test your program. Make sure there are no errors and it functions properly . You can hit [Ctrl or command]+[Shift]+B to compile and run the program. Y our program must run without errors to get full credit! Assignments that do not compile will not be graded. Commit and push (upload) your 5/7/2021 HW39 https://loyno.instructure.com/courses/5769/assignments/160597?module_item_id=426778 3/3repo, including all of your program source files to the base directory of the repo in GitHub for grading. Files must be named correctly and saved as a readable files with the proper extension . You must follow any given input/output constraints to get full credit for your work. I will not accept any programs that use prefix notation for incrementing or non-specific data types (like var and auto). Programs must adhere to common formatting conventions for the programming language you are using.