Question: Binary trees in Java Write a complete binary tree program that will take user input (keyboard or file) and create a binary tree from the

Binary trees in Java

Write a complete binary tree program that will take user input (keyboard or file) and create a binary tree from the input.

Input should be numeric.

Store the input into a binary tree. You have to write your own binary tree code with all classes.

Write code to print out all the binary tree traversals we done in class. Such as: in-order, pre-order, post-order and BFS

After you create the tree present the user with a menu:

  1. Search for a number

If search fails. Ask the user if they want to add that number

If they say yes add the number

  1. Delete a number

If the number does not exist print out appropriate error to the user.

Delete and add you should print out the binary tree data before and after so that the user can see if it was added or deleted.

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!