Bahria University, Lahore Campus
Department of Computer Science
Lab Journal 05
(Fall 2024)
Course: Data Structures and Algorithm - Lab Date: _______________
Course Code: CSL-221 Max Marks: 10
Faculty’s Name: Rabia Masood
Name: _____________________ Enroll No: ___________________ Class:
______________
Objective(s):
Upon completion of this lab session, learners will be able to:
Implement Doubly Linked List and its helping functions (insertion from start, insert
from end, insert from any point, delete from start, delete from end, delete from any
point, and display)
Remove duplicate numbers present in a Linked List.
Lab Tasks:
Task 1
Implement doubly linked list data structure and perform following operations.
Insert from start ()
Insert from end ()
Delete from start ()
Delete from end ()
Display ()
Note: The program should contain main menu in such a way that the user can select either of
the options until desires. Additionally, the input to the node should be taken from the user.
Task 2 (Bonus)
Add additional function remove_duplicates () in Task 1. The function should first display all
elements present in a linked list and then all duplicate values/numbers should be removed
from the list. The final list should contain non-duplicate nodes and only one occurrence of
duplicate number.
Sample Output:
Original Linked List: 2 3 1 4 5 6 2 3 7 1 2 5 4 4 3
After Removing duplicates: 2 3 1 4 5 6 7
%
Enrollment Number: ____________________________
Lab Grading Sheet :
Max
Obtained
Task Mark Comments(if any)
Marks
s
1. 10
2. 0
Total 10 Signature
Note : Attempt all tasks and get them checked by your Lab Instructor. Also for each
task, attach a screenshot of the output.
Page 2 of 2