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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started