You are on page 1of 1

Linked List Exercises

Imagine that you as a developer, support from java.ultil library: Write a doubled-
linked-list data structure to create and hold information of students in a class.
The information of student include:
+studentID: String
+name: String
+average,mark1,mark2,mark3: double

Use your created linked list to write the following methods:

void addFirst(Student s) : add a student to the beginning of the list


void addLast(Student s) : add a student to the end of the list
void addPos(Student s,int k): add a student to the position k of the list
void removeByID(String key): delete student by Student ID
Student search(String key): get student info by StudentID
Student get(int k): get student by position k
Student max(): get student(s) with the highest average

You might also like