Question: You are to use Binary Trees to do this Program. Write a complete program, which will process several sets of numbers: For each set of

You are to use Binary Trees to do this Program.
Write a complete program, which will process several sets of numbers:
For each set of numbers you should:
Create a binary tree.
Print the tree using inorder,preorder, and postorder.
Call a method Count which counts the number of nodes in the tree.
Call a method Children which prints the number of children each node has.
Inset and delete several nodes according to the instructions given.
Print the tree again using inorder,preorder, and postorder.
Call a method Count again which counts the number of nodes in the tree.
Call a method again Children which prints the number of children each node has.
Data to be used
Use a value to determine end of data (example -999)
Set #1: 1234567891011121314151617181920-999
Insert 21, Delete 16, Insert 30, Delete 10, Delete 12, Delete 2
Set #2: 315-999
Insert 3, Insert 14, Insert 33, Insert 2, Insert 6
Set #3: 11257512376090815324550679795-999
Insert 21, Delete 60, Insert 30, Delete 45, Delete 97, Delete 25
Set #4: 1504060393427108215-999
Insert 21, Delete 139, Insert 34, Delete 27, Insert 12, Delete 82
Set #5:2-999
Delete 2
Set #6:34653748151692564374-999
Insert 21, Delete 34, Insert 30, Insert 10, Insert12, Insert 2

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 Accounting Questions!