I have Binary Search Tree containing student records , consisting of ID and first and last name of the student , age and email and phone number .
All students will be stored in a Binary Search Tree based off of their student ID number, and it will be guaranteed that this ordering of students (by ID) will be the exact same as the alphabetical ordering by last name and then first name.
I make method to find node by the student ID .
This is the code
private Unfstudent findNode(Unfstudent student, int id) {
if (student == null)
return null;
}
if (id < student.getID()) {
return findNode(student.getLeft(), id);
}
else if (id > student.getID()) {
return findNode(student.getRight(), id);
}
else {
return student;
}
}
I want to make method to find node by the student first name and last name .
Can anyone help me?