Question: Java code and no JOption pane please. Thanks!: Code the generic version of the linked-based Binary Search Tree using the generic features of Java 5.0,

Java code and no JOption pane please. Thanks!:

Code the generic version of the linked-based Binary Search Tree using the generic features of Java 5.0, and provide a driver program to demonstrate that the method functions properly. The driver program should declare two binary search tree objects: one to store Listing objects as defined in Figure 2.16 with a getKey method added to the class, and the other to store Student objects as described in Exercise 30.

Exercise 30 Instructions:

A database is to be developed to keep track of student information at your college. Their names, identification numbers, and grade point averages will be included. The data set will be accessed in the key field mode, with the student's name being the key field. Code a class named Listing that defines the nodes. The class must comply with the guidelines that permit student information nodes to be stored in the fully encapsulated BinaryTree structure discussed in this chapter. As such, your class should include all the methods in the class shown in Figure 2.16 and include a getKey method. Test it with a progressively developed driver program that demonstrates the functionality of all of its methods.

Here is the Listing Code already created based on Figure 2.16:

public class Listing7 { private String name; private String number; private String gpa; public Listing7(String name, String number, String gpa) { this.name = name; this.number = number; this.gpa = gpa; } public String toString() { return("Name is " + name + " Number is " + number + " GPA is " + gpa ); } public Listing7 deepCopy() { Listing7 clone = new Listing7(name, number, gpa); return clone; } public int compareTo(String targetKey) { return (number.compareTo(targetKey)); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getNumber() { return number; } public void setNumber(String number) { this.number = number; } public String getGPA() { return gpa; } public void setGPA(String gpa) { this.gpa = gpa; } public String getKey() { return name; }

}

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!