Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING JAVA TO WRITE A PROGRAMMING Create a class for a binary tree named BT. Each node in the tree should have data, a reference
USING JAVA TO WRITE A PROGRAMMING
Create a class for a binary tree named BT. Each node in the tree should have data, a reference to the node's left sub-tree, and a reference to the node's right sub-tree. For the purposes of this project, the data in the nodes can be integers. The binary tree should have a height property, a size property, which is the number of nodes in the tree, and the following methods: 1. a null constructor 2. a constructor that builds a tree from a specified array of integers. The tree does not need to be a balanced tree. note: remember to address the height and size properties when building a tree from a specifed array. 1. preorder iterate (list all nodes in order according to the preorder traversal of the tree) 2. inorder iterate (list all nodes in order according to the inorder traversal of the tree) 3. postorder-iterate (list all nodes in order according to the postorder traversal of the tree) 4. search- -given a key value,tell us whether or not the integer is in the tree. 5. max -return the maximum value in the tree 6. min - return the minimum value in the tree 7. insert 8. delete 9. destroy Test each method to ensure that it works properlyStep 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