Ask a question from expert

Ask now

Data Structures and Algorithms: Linked List Implementation for Student Records

2 Pages862 Words210 Views

Added on  2019-09-18

About This Document

This tutorial covers the implementation of a doubly circular linked list to manage student records in Java. It includes the creation of Student, Node, and CircularList classes, as well as an Application class to manage the data. The tutorial provides detailed requirements for each class and method, including add, remove, search, and display operations.

Data Structures and Algorithms: Linked List Implementation for Student Records

   Added on 2019-09-18

BookmarkShareRelated Documents
CS3810 Data Structures and AlgorithmsFall 2016Assignment 3 (Linked List and its applications):Assign Date: 11/2/16 Due Date: 11/21/16Programming:A department needs to manipulate student records. The basic operations include add, remove, search and display the records. This system is implemented by usinga doubly linked circular list. See the detail requirements for the implementation.Detail Requirements:The system will be implemented by a doubly circular linked list. The following classes should be created in this system.1.Student class - contains two class fields and several methods: name - The first and last names are in one stringid – It is a random number generated when inserting the object into the list. It must be a unique number.set/get methodstoString() method to allow displaying the content of an object. Organize the data properly for displaying.2.Node class – represents a node in the list. The data part contains one object of Student class. The link part contains two links, next and prev.3.CircularList class – represents a doubly linkedcircular list. It is defined as follow:1)The class has two instance variables only: cursor (Node type) - always point to the current element in the list [Note: There are no ‘first’ and ‘last’ references in the list and you should not define another pointer ‘current’ in any cases. The ‘cursor’ is the ‘current’.] size (int type) – the number of elements in the list2)The list is doubly linked and unordered.3)The list has no head and no tail.4)The cursor is null if the list is empty.5)If the list contains only one element e1, the cursor refers to e1, and the next and the prev of e1 point to e1 itself.6)If the list contains two elements e1 and e2, the next and previous of e1 point to e2, and the next and previous of e2 point to e1 (means they point to each other).7)The operations (methods) of the class are:void add (Node newNode) – add a new element after the node pointed by the current cursor. The newNode has to be unique (by testing the id).Node remove (int key) – remove the element in which the id of the object matches the given key. The method returns null if the key is not found; otherwise it returns the node of the removed element.
Data Structures and Algorithms: Linked List Implementation for Student Records_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Interview Questions

Vehicle Data Inventory System