Final Dsu Microproject
Final Dsu Microproject
Final Dsu Microproject
JAYAWANTRAO SAWANT
POLYTECHNIC, Handewadi Road,
Hadapsar, Pune-28
Department of Computer Engineering
Academic Year 2022-23
MICRO PROJECT
Academic year: 2023-24
1 SAMIKSHA 87 2207110401
DEEPAK
SING
2 SNEHAL 177 2207110436
SHITAL
SHAHANE
3 PRIYANKA 127 2207110448
MORE
4 ZEBA 132 2207100172
SHAIKH
Introduction to project 2
2
PROJECT ABSTRACT 3
3
Algorithm 4
4
Flowchart 5
5
6 Program 8
7 CONCLUSION 12
JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC,
Handewadi Road, Hadapsar, Pune-28
Department of Computer Engineering
Academic Year 2022-23
Brief Introduction: Stack is a linear data structure that follows the Last in,
First out principle(LIFO). Stack supports various operations like push, pop, peek,
empty, and size. It can be implemented using an array and linked list. The benefit
of implementing a stack using a linked list in C over arrays is that it allows to
grow of the stack as per the requirements, i.e., memory can be allocated
dynamically.
PROJECT ABSTRACT
push()
pop()
struct Node
{
int data;
struct Node *next;
}*top = NULL; // Initially the list is empty
void push(int);
void pop();
void display();
int main()
{
int choice, value;
printf("\nIMPLEMENTING STACKS USING LINKED LISTS\n");
while(1){
printf("1. Push\n2. Pop\n3. Display\n4. Exit\n");
printf("\nEnter your choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("\nEnter the value to insert: ");
scanf("%d", &value);
push(value);
break;
case 2: pop();
break;
case 3: display();
break;
case 4: exit(0);
break;
void pop()
{
if(top == NULL)
printf("\nEMPTY STACK\n");
else{
struct Node *temp = top;
printf("\nPopped Element : %d", temp->data);
printf("\n");
top = temp->next; // After popping, make the next node as TOP
free(temp);
}}
void display()
{
// Print the stack
if(top == NULL)
printf("\nEMPTY STACK\n");
else
{
printf("The stack is \n");
struct Node *temp = top;
while(temp->next != NULL){
printf("%d--->",temp->data);
temp = temp -> next;
}
printf("%d--->NULL\n\n",temp->data);
}}
OUTPUT:
Pushing elements into the stack
Note: Every course teacher is expected to assign marks for group evaluation in first 3
columns and individual evaluation 4th column
Signature: ………………………
Note: Every course teacher is expected to assign marks for group evaluation in first 3
columns and individual evaluation 4th column
Signature: ………………………
Teachers Evoluation Sheet
Name of the student: zeba shaikh Enrollment No:2207100172
Academic Year: 2023-24 Name of the Faculty: MRS.A.R.MOHITE
Course:DSU Course code: 22317 Semester: III
Title of the project: Implement stack using linked list
Course outcome achived:
A: We learned to write c programs.
B: use stack operation by using linked list
Note: Every course teacher is expected to assign marks for group evaluation in first 3
columns and individual evaluation 4th column
Signature: ………………………
Teachers Evoluation Sheet
Name of the student: snehal shahane Enrollment No:2207110436
Academic Year: 2023-24 Name of the Faculty: MRS.A.R.MOHITE
Course:DSU Course code: 22317 Semester: III
Title of the project: Implement stack using linked list
Course outcome achived:
A: We learned to write c programs.
B: use stack operation by using linked list
Note: Every course teacher is expected to assign marks for group evaluation in first 3
columns and individual evaluation 4th column
Signature: ………………………