Question: Need help with my c++ code, thank you. Using the BinaryTree.h file (shown below), write a program that inserts the following numbers 20, 5, 8,

Need help with my c++ code, thank you.

Using the BinaryTree.h file (shown below), write a program that inserts the following numbers 20, 5, 8, 3, 12, 9, 2, 16 into the tree in that order.

Announce the numbers being inserted

Output the number of nodes, and then display them in order

Delete 8 and 12 from the tree

Output the number of nodes, and then display them in order

Display the tree in postorder

Modify the header as needed to output the values horizontally

Display the tree as it exists and replace the Xs with the correct value in the nodes. Use cout statements and only display branches that exist

The program will have the header file (BinaryTree.h) and your main program. NOTE: Older compilers do not accept nullptr, use NULL to initialize pointers.

Need help with my c++ code, thank you. Using the BinaryTree.h file

Inserting nodes with 20, 5, 8, 3, 12, 9, 2, and 16 The number of nodes in the tree is now 8 Here are the values in the tree in order: 2358912 16 29 Now deleting 8 from the tree... Now deleting 12 from the tree... The number of nodes in the tree is now 6 Here are the values in the tree in order 2 3 5 9 16 20 Here are the values in the tree in POST order: 2 3 9 16 5 20 Tree Process returned 0 (0x0 excution time 0.016 s Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!