Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

A

Micro project report On

“Perform operatioins on singly linked list ”


SUBMITTED TO M.S.B.T.E., Mumbai
For the Award of
DIPLOMA COMPUTER ENGINEERING BY

Roll no Name of Student Enrollment no


Atharv Maruti Khadatare 2212140111
Anand Digambar Ukirde 22121
Laxman Nagnath Khandekar 2212140131
Shrijeet Sharad Kashid
UNDER THE GUIDANCE OF

DEPARTMENT OF COMPUTER ENGINEERING


NBA ACCREDIATED

SVP’s Swami Vivekanand Institute Of Technology (Polytechnic), Solapur


Solapur - 413255
2023-24
AFFILIATED TO

M.S.B.T.E.
Evolution sheet for Micro Project

Academic Year:- 2023-24 Name of Faculty:-


Course:- Computer Engineering Course code:- CO3I
Subject:- Data Structure Using C Subject Code:- 22317
Semester:- 3rd Scheme:- I

Title of Project:- Perform operatioins on singly linked list.

Comments/Suggestions about team work/leadership/inter-personal communication (if any)

Marks out of 4
Marks out of 6 Total
for
for mars
Roll No Name of students performance
performance in out
in oral/
group activity of 10
Presentation

Atharv Maruti Khadatare


2212140111
Anand Digambar Ukirde
2212140236
Laxman Nagnath Khandekar
2212140131
Shrijeet Sharad Kashid
2212140234

Name and
Signature of
faculty
SVP’s SWAMI VIVEKANAND INSTITUTE OF TECHNOLOGY(POLY), SOLAPUR

CERTIFICATE

This is to certify that the Project report entitled


“Text Editor (Notepad)”
Submitted by
Roll no Name of Student Enrollment no
Atharv Maruti Khadatare 2212140111
Anand Digambar Ukirde
Laxman Nagnath Khandekar 2212140131
Shrijeet Sharad Kashid

is a bonafide work carried out by above students, under the guidance of . and it is
submitted towards the fulfillment of requirement of MSBTE, Mumbai for the award of Diploma in
Computer Engineering at SVP’s COE (Polytechnic), Solapur during the academic year 2022-2023.

Guide

HOD Principal

Place: Solapur

Date: / /
INDEX

Sr.No Title
1. Introduction
2. Resources Used
3. Advantages
4. Disadvantages
5. Applications of Linked List in C
6. Methodology
7. Singly Linked List
8. Syntax
9. Conclusion
10. References
Acknowledgement

“Perform operatioins on singly linked list” has been developed successfully with a great contribution
of two students in a period of two months. We like to appreciate their guidance, encouragement and
willingness since without their support the project would not have been a success. We would like to give our
heartfelt gratitude to Principal , Guide & HOD who is the supervisor of our
project for helping and encouraging us in many ways to make our project a success. We would never been able
to finish our work without great support and enthusiasm from friends and support from our family. We would
like to thank the department of Computer Engineering, for giving us permission to initiate this project and
successfully finish it.
Introduction:-

In Computer Science one of the most basic and fundamental data structures is the linked list,
which functions similarly to an array. The principal benefit of a linked list over a conventional
array is that the list elements can easily be inserted or removed without reallocation of any
other elements.In some programming languages the size of an array is a concern and one of the
ways to overcome that problem and allow dynamically allocated data is sing linked
lists.Luckily in Ruby arrays aren’t limited to a certain size, so you don’t have to think about
overcoming that limitation.So if array size is not a limitation in Ruby, are linked lists really
necessary? The short answer to that is no; however, it’s the simplest of the dynamic data
structures and it will give you a solid foundation, so you can understand more complex data
structures like graphs and binary trees with more ease.Structure of a Linked ListA
linked list is a linear collection of data elements called nodes that “point” to the next node by
means of a pointer.Each node holds a single element of data and a link or pointer to the next
node in the list.A head node is the first node in the list, a tail node is the last node in the list.
Below is a basic representation of a linked list:[ NODE(head) ] -> [ NODE ] -> [ NODE(tail) ]
-> ni

Resources Used:

Sr. No. Specification Remark


1 Intel Core i3/ i5, RAM 4GB As per requirement
2 Operating System – Windows 10 As per requirement
3 Application – WPS Office As per requirement
Advantages:-

 It is a dynamic data structure.

 You can decrease and increase the size of the linked list at run time.

 In the linked list, you can easily insert and delete a node.

 It’s access time is very fast.

 In the linked list, memory is well utilized

Disadvantages:-

 It requires more memory than an array.

 It is difficult to traverse the nodes in a linked list.

 Reverse traversing is very difficult to implement in a linked list.

Applications of Linked List in C:-


 You can use linked lists on graphs and hash tables.

 In stack and queue, you can implement linked lists.

 With the help of linked lists, you can do dynamic memory allocation.

 With a linked list, you can perform arithmetic operations on long integers.
Methodology:-

1) Knowing the basics of the topic.


2) Decide aim of the project and collect the data.
3) Prepare project proposal.
4) Search Literature reviews.
5) Analysis of data.
6) Discussion over preparing and correction in booklet and report.
7) Converting the content of project in report writing.
8) Checking and correction in report writing.
9) Rechecking and finalizing report writing.
10) Final submission and oral presentation of micro project.

Singly Linked List:-


2Singly linked list is the most common linked list among the others. The singly linked list can be traversed
only in one direction. It is a collection of ordered sets of elements. In singly linked list, Each node has a data
and a pointer to the next node.

Syntax:-
struct node{
int data;
struct node *next;
}
Below, we have created a singly linked list of three members.

Performing operations on Singly Linked List:-


Below is a list of operations which you can perform upon a Singly Linked List.
1. Creating Nodes in Linked List :-
struct node
{
int data;
struct node *next;
};
struct node *HEAD, *point;
point = (struct node *)malloc(sizeof(struct node *));
2. Insertion in Linked list:-
In a Singly linked list, you can perform insertion at different locations.

Operation What it does


Doing insertion at the beginning of the list You can insert any element at the front of the linked list.
Inserting at the end of the linked list You can perform insertion at the last of the linked list.
Inserting after the specified node You can also insert a new node after a specified node.

Source Code:-
#include <stdio.h>
#include<cionio.h>
struct node {
int info;
struct node* link;
};
struct node* start = NULL;
void traverse()
{
struct node* temp;
if (start == NULL)
printf("\nList is empty\n");
else {
temp = start;
while (temp != NULL) {
printf("Data = %d\n",
2temp->info);
temp = temp->link;
}
}
}
void insertAtFront()
{
int data;
struct node* temp;
temp = malloc(sizeof(struct node));
printf("\nEnter number to" " be inserted : ");
scanf("%d", &data);
temp->info = data;
temp->link = start;
start = temp;
}
void insertAtEnd()
{
int data;
struct node *temp, *head;
temp = malloc(sizeof(struct node));
printf("\nEnter number to"" be inserted : ");
scanf("%d", &data);
temp->link = 0;
temp->info = data;
head = start;
while (head->link != NULL) {
head = head->link;
}
head->link = temp;
}
void insertAtPosition()
{
struct node *temp, *newnode;
int pos, data, i = 1;
newnode = malloc(sizeof(struct node));
printf("\nEnter position and data :");
scanf("%d %d", &pos, &data);
temp = start;
newnode->info = data;
newnode->link = 0;
while (i < pos - 1) {
temp = temp->link;
i++;
}
newnode->link = temp->link;
temp->link = newnode;
}
int main(){
int choice;
while (1) {
printf("\n\t 1 To see list\n");
printf("\t 2 For insertion at"" starting\n");
printf("\t 3 For insertion at"" end\n");
printf("\t 4 For insertion at ""any position\n");
printf("\t 5 For deletion of " "first element\n");
printf("\t12 To exit\n");
printf("\nEnter Choice :\n");
scanf("%d", &choice);
switch (choice) {
case 1:
insertAtFront();
break;
case 2:
insertAtEnd();
break;
case 3:
insertAtPosition();
break;
case 4:
exit(1);
break;
default:
printf("Incorrect Choice\n");
}
}
getch();
}
Conclusion:-

Explaining and summarizing singly linked list and circular singly list.
To develop a sense of team rapport, dissolve group barriers and create the foundation for good
teamwork .
To learn to utilize rapport to enrich all your communications and relationships.

References:-

You might also like