Question: Java Binary Trees Task 6.1 Trees are built up using nodes. Each node contain: a data element: a reference to a generic type T a
Java Binary Trees


Task 6.1 Trees are built up using nodes. Each node contain: a data element: a reference to a generic type T a left node: a reference to the left sub-tree of type Node a right node: a reference to the right sub-tree of type Node Create a Java class Node which contains the above information. Implement reasonable setters and getters in your Node class. Test out your class by creating nodes and calling various methods on the nodes in the main method. O Task 6.2 Create a class Tree to model a binary tree. This class should contain a single reference to the root node of the tree. Again, test out your class by creating a tree and nodes objects; and by calling various methods on them in the main method. Task 6.3 Write the method constructTree () in the Tree class and create the following tree to find out if a person is fit or not? We assume the root node starts with the following question: age
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
