0% found this document useful (0 votes)
75 views3 pages

CSE 207 - Lab-2

The document provides instructions for a lab assignment on linked lists. The objective is for students to learn how to create linked lists and perform operations like inserting and deleting nodes. The lab contains 9 exercises - students will create a menu to select the exercises, then create a linked list and perform operations like adding nodes to the beginning, middle or end, deleting nodes, and reversing or removing duplicates from the list. The exercises guide students through basic linked list concepts and manipulations.

Uploaded by

tamim
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)
75 views3 pages

CSE 207 - Lab-2

The document provides instructions for a lab assignment on linked lists. The objective is for students to learn how to create linked lists and perform operations like inserting and deleting nodes. The lab contains 9 exercises - students will create a menu to select the exercises, then create a linked list and perform operations like adding nodes to the beginning, middle or end, deleting nodes, and reversing or removing duplicates from the list. The exercises guide students through basic linked list concepts and manipulations.

Uploaded by

tamim
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/ 3

East West University

Department of Computer Science & Engineering


A/2, Jahurul Islam Avenue, Jahurul Islam City, Aftabnagar, Dhaka-1212
_______________________________________________________________
Lab Manual : 01
Course Code : CSE207
Course Title : Data Structure
Instructor : Dr. Maheen Islam, Associate Professor, CSE, East West University

Objective:
The objective of this lab is to provide basic concept of linked list. At the end of the lab, students
are able:
➢ To learn how to create a linked list
➢ To learn how to insert new nodes in linked list
➢ To learn how to delete a node from linked list.
➢ To learn how to reverse nodes of linked list.

Linked list:
A linked list is a sequence of data structures, which are connected together via links. Linked List
is a sequence of links which contains items. Each link contains a connection to another link.
Linked list is the second most-used data structure after array.
Linked list can be visualized as a chain of nodes, where every node points to the next node.

Page 1 of 3
Now you have to perform the following lab task on linked list:

Exercise 1:
Create a Menu
Create a menu that will display all the exercises given below (Exercise 2 to Exercise 8) as a list
and prompt user to select any desired option. The menu can be designed in below format.

1. Insert new node


2. Insert node at beginning
3. Insert node at any position………

Exercise 2:
Create Linked List
Creating linked list is a more than one step activity. First, create a node using structure and find
the location where it has to be inserted. Then input the data and store it in the allocated
memory space. Use the pointer part of the node to point another node and insert the node at
the end of the previously inserted node.

Exercise 3:
Insert New Node at beginning
After completing exercise 1 you have a newly created linked list. Then take a new node and add
it in the beginning of the linked list.

Exercise 4:
Insert New Node at any position
Take a position number to insert a new node. Then take a new node and add it in the specified
position number.

Exercise 5:
Delete Node from last position
Delete the last node from the linked list and make the pointer part NULL of the previous node
of the last node

Exercise 6:
Delete Node from beginning
Delete the first node.

Page 2 of 3
Exercise 7:
Delete Node from any position
Take a position number to delete a node from that position number.

Exercise 8:
Reverse Linked list
You have to reverse the linked list in following format.

Exercise 9:
Remove Duplicate data from Linked list
You have to remove all duplicate entry from your linked list. For this you have to create a list of
data containing duplicate data and after executing, your program will provide a list, by
removing all duplicate data.

Example:
Input: 1 2 1 1 2 3
Output: 1 2 3

Page 3 of 3

You might also like