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

Assignment 2

give its answer

Uploaded by

Maaz Sajid
Copyright
© © All Rights Reserved
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)
16 views

Assignment 2

give its answer

Uploaded by

Maaz Sajid
Copyright
© © All Rights Reserved
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/ 2

CS 201 Data Structures And Algorithms

Assignment # 02
1.1 Guidelines
1. Any plagiarism in assignment will lead to zero marks.
2. CHAT-GPT and Generative AI
a. Do not use ChatGPT to generate entire pieces of academic writing but only for
generating ideas, etc.
b. Clearly identify which parts of your writing were generated with the help of
ChatGPT.
c. Use ChatGPT only as a starting point. Use your critical thinking and analysis for
evaluation.
d. Always cite any sources that you use. This is important for avoiding plagiarism and
giving credit where credit is due.
e. Be aware of the potential for bias in the information generated by ChatGPT. Always
critically evaluate the information and be cautious of potential biases or
inaccuracies.

1.2 Due Date and Time: 27th November 2023 (End of Day) – Submit via MS Teams

1.3 Submission Policy


To avoid last minute problems (unavailability of slate, load shedding, network down etc.), you are
strongly advised to start working on the assignment from day one.

1.4 Plagiarism Policy


Solu ons of all the sec ons will be placed in a central repository and will be scanned for plagiarism.
All the plagiarized solu ons will be marked zero. AI will be used to detect possible forfeit of the
plagiarism detec on so ware. If found will lead to a disciplinary case.

Ques on 1 (Handwri en answer scanned as single pdf):

You are tasked with managing a circular linked list that stores information about students. Each node
in the circular linked list represents a student and contains the following information:

 Student registra on ID
 Name
 SGPA
 CGPA

You need to implement the following functionalities:

1. Insertion: Implement a function to insert a new student into the circular linked list while
maintaining the order based on their GPA in descending order. The circular linked list should
be initially empty.
2. Deletion: Implement a function to delete a student from the circular linked list based on
their Student ID.
3. Search: Implement a function to search for a student in the circular linked list based on their
Student ID.
4. Display: Implement a function to display the information of all students in the circular linked
list.
5. Sorting: Implement a sorting algorithm (e.g., Selection Sort, Insertion Sort) to sort the
circular linked list based on SGPA and CGPA in descending order based on the user input.
6. Searching: Implement a searching algorithm (e.g., Binary Search) to search for a student
based on their GPA.
7. Update SGPA or CGPA: Implement a function to update the SGPA or CGPA based on the
user input of a student based on their Student ID.
8. Statistics: Implement a function to calculate and display the average GPA of all students in
the circular linked list.

Guidelines:

 Use appropriate data structures and algorithms to efficiently implement the func onali es.
 Ensure that the circular linked list remains circular a er each opera on.
 Test your implementa on with various scenarios to ensure correctness.
 Provide a user-friendly interface for interac ng with the circular linked list.

Bonus (Op onal):

 Implement error handling mechanisms to handle cases such as an a empt to delete a non-
existent student, searching for a non-existent student, etc.
 Implement addi onal sor ng and searching algorithms and compare their performance on
large datasets.

Submission:

Submit the C++ code in handwritten scanned version along with the explanation of your approach,
the choice of algorithms, and any challenges you faced during the implementation.

This assignment is designed to test your understanding of circular linked lists, sorting algorithms, and
searching algorithms. Feel free to adapt the assignment based on your preferences and
requirements.

You might also like