How do you create a node with fullName and studentID in the "add" method and then put them into the correct positions which the name_first and name_second should move until the name in the name_first is larger than the new_Name and name_second is smaller than the new_Name?
public class NodeDemo{
private String fullName;
private int studentID;
private NodeDemo fullNameLink;
private NodeDemo studentIDLink;
public NodeDemo(String newName, int newStudentID, NodeDemo newFullNameLink, NodeDemo newStudentIDLink){
fullName = newName;
studentID = newStudentID;
fullNameLink = newFullNameLink;
studentIDLink = newStudentIDLink;
}
private static NodeDemo startPosition;
public void add(String new_Name, int newStudentID){
NodeDemo name_First = startPosition.fullNameLink;
NodeDemo name_Second = startPosition;
NodeDemo studentId_First = startPosition.studentIDLink;
NodeDemo studentId_Second = startPosition;
NodeDemo node = new NodeDemo(new_Name, newStudentID, null, null);
}
}