In JAVA Using the Data structure of your choice Diagraph AP
In JAVA:
Using the Data structure of your choice ( Diagraph API, Diagraph Search, Topological Sort, Kosaraju-Sharie, or Strong Components), write an application that will take a series of Check objects entered and sort them by check date implementing COMPARATOR. Also name the structure that was used.
Solution
import java.util.Comparator;
public class Employeeone implements Comparable<Employeeone> {
private int id;
private String firstname;
private int age;
private int salary;
public int getId() {
return id;
}
public String getName() {
return firstname;
}
public int getAge() {
return age;
}
public int getSalary() {
return salary;
}
public Employeeone(int id, String name, int age, int salary) {
this.id = id;
this.firstname = name;
this.age = age;
this.salary = salary;
}
@Override
public int compareTo(Employeeone emp1) {
return (this.id – emp1.id);
}
public String toString() {
return \"[id=\" + this.id + \", name=\" + this.firstname + \", age=\" + this.age + \", salary=\" +
this.salary + \"]\";
}
}
}


