Question: Your task is to create a self - sorting, binary tree set that can be used in place of the PersonOrderedSet used in the Nintendo
Your task is to create a selfsorting, binary tree set that can be used in place of the PersonOrderedSet used in the Nintendo Human Resources assignment.
If implemented correctly, minimal changes to Main.java will be needed to your Human Resources code.
An interface is provided to guide your design of SortedTreeSet. Your SortedTreeSet.java class should implement the interface and also have a toString method. You can add more methods if you wish.
IMPORTANT: You do NOT need to implement the get method in your tree. You can remove any calls to get from Main.java. You do NOT need to implement anything equivalent to the PersonImperialSet and all code related to the PersonImperialSet can either be deleted from Main or left alone.
IMPORTANT : The data in the tree MUST remain sorted at all times and must never contain duplicate names. In other words, as the data is added to the tree, it must be automatically inserted in sorted order. You will not get full credit for sorting or removing duplicates after all the data has been inserted.
IMPORTANT : Turn in all of your human resources code including the adjusted Main.java along with SortedTreeSet.java.
Although the following is optional, you might consider adding the following methods and attributes:
A reference to a Tree node's parent and getParent method.
and possibly another method to balance the tree if it is unbalanced!
If you implement a get method that gets values from the tree based on an index then the SortedTreeSet could implement the PersonList interface! Again, this is not mandatory.
USING THIS CODE BASE
public interface SortedTreeSetInterface Binary Tree
public Person getPerson;
public boolean hasLeft;
public void setLeftSortedTreeSet left;
public SortedTreeSet getLeft;
public boolean hasRight;
public void setRightSortedTreeSet right;
public SortedTreeSet getRight;
public void addPerson p;
USING THIS HR TEXT
Name Height cm Weight kg
Mario
Luigi
Bowser
Toad
Mario
Peach
Toad
Bowser
Bowser
Toad
Mario
Peach
Peach
Peach
Peach
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
