MCA Mini Project Documentation Tikamchand
MCA Mini Project Documentation Tikamchand
Mini Project On
Implementation of Stack, Linked List & Queue
Presented By
Name:- Tikamchand M Pise, Roll No:- 40
Name:- Shankar O Zadbuke, Roll No:- 60
Prepared By
Mr. Tikamchand M Pise
MR.Shankar O Zadbuke
12 Aprail, 2021
Index
Overview
The implementation of stack, linked list & Queue project that completed on dated 1 May, 2021 . The purpose of the
project was to this design to study the various operation of stack Linked List and Queue it was the basic resent
choosing this topic also we study that Queue implementation using an array ,linked list and circular linked list .
Each data structure has its own function Users can select from menu for data type selection to build a queue.
All data structure have basic queue functions as well as stack and linked list also.
Scope
Stack:-
A] In subroutine handling application, return address is stored in the stack.
B] Evaluation of expression in computer programing languages.
Any arithmetic calculation can be easily calculated, its representation either in the form of infix of postfix.
C] Prefix and postfix Interconvert ion of expression.
When we choose any arithmetical expression in the algorithm, naturally we use only infix expressions (operand1
Operator operand2).
These expressions are converted into equivalent machine instructions by the compiler using internal stack.
D] In recursive programing application. E] String reversing.
E] Parenthesis Matching etc.
Linked List:-
A] It is a dynamic data structure so we can insert as many nodes as required as run time. But array as maximum size
we cannot insert data after that maximum size.
B] There is no upper limit for the number of nodes in the link lists. We can add new nodes till the memory (RAM) is
free.
C] Insertion and Deletion in between the list as easy as compared to array.
D] Memory can be freed when nodes have to deletd.in array no concept is available to free memory.
E] Many complex application can easily be carried out by using Linked List.
Queue:-
A] Queues are used for many application in computer system basically queues are used in computer for scheduling of
resources to various applications like CPU, Printer etc.
B] In multiuser environment multiple printing jobs are given to the printer very frequently they are organize in the
form of FIFO manner in print queue and given to the printer.
C] In batch programing multiple jobs are combined into batches and the first program is executed first, the second is
executed next and so on in the sequential manner this mentioned in the queue.
Operations
Software Specification
MS windows 10 OS
MS word for documentation
MS Power point for presentation
MS Visual studio 2010
My SQL for storing data
Coding:-
#include <stdio.h>
#include<iostream>
#include<cstdlib>
#include<malloc.h>
#include<conio.h>
using namespace std;
struct node{
int info;
struct node *next;
};
class stack
{
struct node *top;
public:
stack();
void push();
void pop();
void display();
};
stack::stack(){
top = NULL;
}
void stack::push()
{
int data;
struct node *p;
if((p=(node*)malloc(sizeof(node)))==NULL){
cout<<"Memory Exhausted";
exit(0);
}
cout<<"Enter a Number to insert:";
cin>>data;
p = new node;
p->info = data;
p->next = NULL;
if(top!=NULL){
p->next = top;
}
top = p;
cout<<"\nNew item inserted"<<endl;
}
void stack::pop(){
struct node *temp;
if(top==NULL){
cout<<"\nThe stack is Empty"<<endl;
}
else
{
temp = top;
top = top->next;
cout<<"\nThe value popped is "<<temp->info<<endl;
delete temp;
}
}
void stack::display()
{
struct node *p = top;
if(top==NULL)
{
cout<<"\nNothing to Display\n";
}
else{
cout<<"\nThe contents of Stack\n";
while(p!=NULL){
cout<<p->info<<endl;
p = p->next;
}
}
}
int main()
{
stack s;
int choice;
do
{
cout<<"\nEnter your choice:";
cout<<"\n1. PUSH\n2. POP\n3. DISPLAY\n4. EXIT\n";
cin>>choice;
switch(choice){
case 1:
s.push();
break;
case 2:
s.pop();
break;
case 3:
s.display();
break;
case 4:
exit(0);
break;
default:
cout<<"Invalid Choice";
break;
}
}
while(choice);
getch();
return 0;
}
2 :-
#include <stdio.h>
#include<iostream>
#include<cstdlib>
#include<malloc.h>
#include<conio.h>
using namespace std;
struct node
{
int info;
struct node *next;
};
class stack{
struct node *top;
public:
stack();
void push();
void pop();
void display();
};
stack::stack(){
top = NULL;
}
void stack::push()
{
int data;
struct node *p;
if((p=(node*)malloc(sizeof(node)))==NULL)
{
cout<<"Memory Exhausted";
exit(0);
}
cout<<"Enter a Number to insert:";
cin>>data;
p = new node;
p->info = data;
p->next = NULL;
if(top!=NULL){
p->next = top;
}
top = p;
cout<<"\nNew item inserted"<<endl;
}
void stack::pop(){
struct node *temp;
if(top==NULL){
cout<<"\nThe stack is Empty"<<endl;
}
else
{
temp = top;
top = top->next;
cout<<"\nThe value popped is "<<temp->info<<endl;
delete temp;
}
}
void stack::display()
{
struct node *p = top;
if(top==NULL)
{
cout<<"\nNothing to Display\n";
}
Else
{
cout<<"\nThe contents of Stack\n";
while(p!=NULL)
{
cout<<p->info<<endl;
p = p->next;
}
}
}
int main()
{
stack s;
int choice;
do
{
cout<<"\nEnter your choice:";
cout<<"\n1. PUSH\n2. POP\n3. DISPLAY\n4. EXIT\n";
cin>>choice;
switch(choice){
case 1:
s.push();
break;
case 2:
s.pop();
break;
case 3:
s.display();
break;
case 4:
exit(0);
break;
default:
cout<<"Invalid Choice";
break;
}
}
while(choice);
getch();
return 0;
}
Out Put:-
Sr.No.ContentsRemark
1Over view of project
2Scope & Advantages of Stack ,Linked List, & Queue
3Operations Of Stack ,Linked List, & Queue
4Hardware Specification
5Software Specification
6 Code Designing
7Out Put of code or Project screen shoots