Professional Documents
Culture Documents
DSU Microproject
DSU Microproject
M.S.B.T.E.
Evolution sheet for Micro Project
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
Name and
Signature of
faculty
SVP’s SWAMI VIVEKANAND INSTITUTE OF TECHNOLOGY(POLY), SOLAPUR
CERTIFICATE
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:
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.
Disadvantages:-
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:-
Syntax:-
struct node{
int data;
struct node *next;
}
Below, we have created a singly linked list of three members.
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:-