How would you give this a GUI which allows the user to add,search and display the entire tree. Java
public class Duplicate {
public TreeNode root;
public static class TreeNode {
TreeNode left;
int item;
TreeNode right;
TreeNode(TreeNode left, intitem, TreeNode right) {
this.left =left;
this.item =item;
this.right =right;
}
}
public static class Duplicate_Nodes {
int item;
int count;
public Duplicate_Nodes(int item,int count) {
this.item =item;
this.count =count;
}
}
public void print() {
if (root == null) {
OR
OR