Question: Tree ra es AaBbCcDd AaBbCc 1 Normal 1 No Spa Paragraph Tree Traverse Lab Today you will be implementing a simple tree sructure and getting

 Tree ra es AaBbCcDd AaBbCc 1 Normal 1 No Spa Paragraph

Tree ra es AaBbCcDd AaBbCc 1 Normal 1 No Spa Paragraph Tree Traverse Lab Today you will be implementing a simple tree sructure and getting the inorder, postorder, and preorder traversals of this tree In this Lab you will create 2 java files. One will be the main file in which to test your program and the other will contain the Tree ADT Let's start by discussing what will need to be contained within the Tree ADT dass There should be a private Node dass contained within the Tree ADTdass This Node dand contain the fields: data of type Generic, left of type Node and right of type Node. All the methods within this class should be private There should be 2 constructors within this dass One which takes in no parameters and one which takes in a data paramoter Other Methods to be implemented are listed below Getters- get the value from the ields getData getRighNode Setters -set the values of the fields setData) setL eftNode0 Copy * O-copy's the tree and returns the root Node Now to implement the Tree ADT There should be a root Node field which is set to peivate Please implement two constructors: One that takes in no parameters and the other which takes in a data parameter Note that the bellow methods should be public unless otherwise specified Inorder Traversalo .preorder Traversalo . isEmpty0 setTree)-This method should take in a new data value and two trees It will make the postorder Traversal( clear) data value the new node, while making one tree the left branch of this node and the other tree the right branch of this node Ps

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!