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:
-
Search for a number
If search fails. Ask the user if they want to add that number
If they say yes add the number
-
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
Get step-by-step solutions from verified subject matter experts
