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

Labsheet 7

This labsheet involves implementing linked lists in Java. Students will create Node and LinkedList classes to represent singly linked lists, with methods for creation, insertion, deletion, modification, searching, and merging of lists. They will also implement a doubly linked list with tracking of head and tail pointers. Finally, students will create a linked list program to store and manage student details, with a menu system for creation, insertion, searching, deletion, counting nodes, and printing of the student linked list.

Uploaded by

AVD007
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Labsheet 7

This labsheet involves implementing linked lists in Java. Students will create Node and LinkedList classes to represent singly linked lists, with methods for creation, insertion, deletion, modification, searching, and merging of lists. They will also implement a doubly linked list with tracking of head and tail pointers. Finally, students will create a linked list program to store and manage student details, with a menu system for creation, insertion, searching, deletion, counting nodes, and printing of the student linked list.

Uploaded by

AVD007
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSE 2032Y – Data Structures and Algorithms

Labsheet7 (Week 9 and Week 10) on Linked Lists


Objectives: The objective of this labsheet is to work with Linked Lists in Java
Question 1
For the example discussed during lecture, implement the classes Node and LinkedList to
model a singly-linked list (SLL). Develop a class LinkedListApp to manipulate objects of type
LinkedLists e.g. creation of a list, insertion of nodes in the linked list (at the beginning, at the
end and in an ordered manner), deletion from the list (beginning and specific nodes),
modification of nodes data, finding of nodes, display of the linked list, counting the number
of nodes and merging of two linked lists.

Question 2
For the above example, now implement a double-ended SLL which will keep track of both
head and tail in the list and modify the methods which need to be modified, accordingly.

Question 3
Write program that creates a linked list to represent details of students at UoM. The
following details must be kept for each student:
• SID
• First name
• Last name
• Address
• Age
• Gender
• Course enrolled for

Your program must also display a menu to perform the following tasks:
• Create a linked list.
Note: The method to create a linked list makes use of the method insertFirst() or insertLast()
or insertOrdered()
• Insert new nodes to the linked list.
• Search for details pertaining to a particular student.
• Delete details of a particular student.
• Find number of nodes in the linked list.
• Display information pertaining to all students.

The menu options should be as follows:


1. Create linked list
2. Add new student
3. Search for a student
4. Delete a student
5. Find number of students
6. Print student details
7. Exit

You might also like