Algorithms and Data Structures

Case Study 1 – Vaccination Centre

Linked Lists- Case study 1

In this assessment, students will analyse a case and develop linked structures by using pointers and finally write code.

Don't use plagiarized sources. Get Your Custom Essay on
Algorithms and Data Structures
Just from $13/Page
Order Essay

 

Due in week 7 40% 1,2,3,4

Case study:

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers as shown in the below image:

Diagram  Description automatically generated

Each element in the link is called a node which is composed of two parts:

a. Data stored by the node

b. Link pointed to the next node in the linked list

In this assessment 2, you are required to develop a Linked List in visual studio called LinkedList.cpp which uses a Linked List to the order in which people arrive at a vaccination clinic.

1. Node in the linked list with appropriate data types: each node stores the person’ name and the person’s current position (index) in the Linked List and link to the next node in the Linked List. Every time a new person arrives, a new node is created and added to the linked list. The position (index) of new node is one more than that of the previous node.

2. Deletion − Deletes a node at the beginning of the linked list: method signature is void deleteFirst()

3. Insert Last − Adds a node at the end of the linked list: method signature is void insertLast(String newPersonName)

4. Delete Last − Deletes a node from the end of the linked list: method signature is void deleteLast()

5. Insert before − Adds a node before another node (according to the provided index in the method parameter) of the linked list: method signature is void insertAfter(int index)

6. Delete − Deletes a node from the linked list using the index: method signature is voide deleteAfter(int index)

7. Search – Search through the linked list to identify the first occurrence of node with match data against the target: method signature is int search(String PersonName)

8. Display − Displays the complete linked list in a forward manner: method signature is String display( )

 

ORDER NOW »»

and taste our undisputed quality.