Question: 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

USING JAVA TO WRITE A PROGRAMMING Create a class for a binary

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 properly

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!