0% found this document useful (0 votes)
221 views

Linked List Exercises

This document describes how to write a doubly-linked list data structure in Java to store student information, including student ID, name, and test marks. It lists methods needed for the linked list such as adding students to the beginning, end, or a specified position of the list, removing a student by ID, searching for a student by ID, getting a student by position, and getting the student(s) with the highest average marks.

Uploaded by

Phạm V. Nghĩa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
221 views

Linked List Exercises

This document describes how to write a doubly-linked list data structure in Java to store student information, including student ID, name, and test marks. It lists methods needed for the linked list such as adding students to the beginning, end, or a specified position of the list, removing a student by ID, searching for a student by ID, getting a student by position, and getting the student(s) with the highest average marks.

Uploaded by

Phạm V. Nghĩa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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