SlideShare a Scribd company logo
5
Most read
6
Most read
7
Most read
STACK DATA
STRUCTURE
1
Presented by: Rabin BK
BSc.CSIT 4th Semester
 Introduction
 Linear data structure
 Stack implementation
 References
2
Introduction
3
 A data structure is a particular way of organizing data in a computer so
that it can be used effectively
 The idea is to reduce the space and time complexities of different tasks
and improve efficiency
 A data structure is a specialized format for organizing and storing data.
 The linear and non-linear data structure is the subclassification of the
data structure
The linear data structure arranges the data into a sequence and follow
some sort of order. E.g., Array, queue, stack, linked list, etc.
The non-linear data structure does not organize the data in a sequential
manner. E.g., Tree and graph.
Linear data structure
4
 The data elements construct a sequence of a linear list.
 The elements are adjacently attached to each other and in a specified
order.
 It consumes linear memory space, the data elements are required to
store in a sequential manner in the memory.
 It does not make a good utilization of memory and result in memory
wastage.
 The data element are visited sequentially where only a single element
can be directly reached.
 The examples included in the linear data structure are array, stack,
queue, linked list, etc.
Stack
5
 Stack is basically a data object
 The operational semantic (meaning) of stack is LIFO i.e. last in first out
 It is an ordered list of elements n , such that n>0 in which all insertions
and deletions are made at one end called the top.
 Primary operations defined on a stack:
 PUSH : add an element at the top of the list.
 POP : remove the at the top of the list.
 Also "IsEmpty()" and "IsFull" function, which tests whether a stack is
empty or full respectively.
Stack
6
Example :
 Practical daily life: a pile of heavy books kept in a vertical box, dishes kept one
on top of another
 In computer world: In processing of subroutine calls and returns; there is an
explicit use of stack of return addresses.
 Also in evaluation of arithmetic expressions, stack is used.
 Large number of stacks can be expressed using a single one dimensional
stack only. Such an array is called a multiple stack array.
 For all the standard stack operations (push, pop, isEmpty, size), the worst-
case run-time complexity can be O(1).
 Push and pop are also O(1) because they only work with one end of the
data structure - the top of the stack.
Stack
7
if(top >= 10)
{
cout << "Stack Overflow n";
}
else
{
a[++top] = x;
cout << "Element Inserted n";
}
if(top < 0)
{
cout << "Stack Underflow n";
return 0;
}
else
{
int d = a[top--];
return d;
}
References
• https://www.studytonight.com/data-structures/stack-data-structure
• http://pages.cs.wisc.edu/~siff/CS367/Notes/stacks.html
• https://cdn-images-1.medium.com/max/800/1*kkK3EZNOzBsuwkDNvSVR9g.gif
8
Queries
9

More Related Content

What's hot (20)

PPTX
queue & its applications
somendra kumar
 
PPTX
Link_List.pptx
sandeep54552
 
PPTX
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Muhammad Hammad Waseem
 
PDF
Singly linked list
Amar Jukuntla
 
PPTX
Binary Search Tree in Data Structure
Dharita Chokshi
 
PPTX
Queue in Data Structure
Janki Shah
 
PPTX
Presentation on Elementary data structures
Kuber Chandra
 
PPTX
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLE
DrkhanchanaR
 
PPT
1.5 binary search tree
Krish_ver2
 
PPTX
Sparse matrix and its representation data structure
Vardhil Patel
 
PPT
Data Structure and Algorithms Linked List
ManishPrajapati78
 
PDF
Algorithm and Data Structure - Queue
AndiNurkholis1
 
PPTX
Stacks and Queue - Data Structures
Dr. Jasmine Beulah Gnanadurai
 
PPTX
AVL Tree Data Structure
Afaq Mansoor Khan
 
PPTX
The Stack And Recursion
Ashim Lamichhane
 
PPT
Files in c++ ppt
Kumar
 
PPT
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 
PPTX
Data structure Stack
Praveen Vishwakarma
 
PDF
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 
queue & its applications
somendra kumar
 
Link_List.pptx
sandeep54552
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Muhammad Hammad Waseem
 
Singly linked list
Amar Jukuntla
 
Binary Search Tree in Data Structure
Dharita Chokshi
 
Queue in Data Structure
Janki Shah
 
Presentation on Elementary data structures
Kuber Chandra
 
Unit 3 - Function & Grouping,Joins and Set Operations in ORACLE
DrkhanchanaR
 
1.5 binary search tree
Krish_ver2
 
Sparse matrix and its representation data structure
Vardhil Patel
 
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Algorithm and Data Structure - Queue
AndiNurkholis1
 
Stacks and Queue - Data Structures
Dr. Jasmine Beulah Gnanadurai
 
AVL Tree Data Structure
Afaq Mansoor Khan
 
The Stack And Recursion
Ashim Lamichhane
 
Files in c++ ppt
Kumar
 
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 
Data structure Stack
Praveen Vishwakarma
 
Algorithms Lecture 4: Sorting Algorithms I
Mohamed Loey
 

Similar to Stack Data Structure (20)

PPTX
chapter three ppt.pptx
selemonGamo
 
DOC
Data Structure
Ibrahim MH
 
PPTX
Stack data structure in Data Structure using C
Meghaj Mallick
 
PPTX
Introduction to stack
Kavya Shree
 
PPT
Unit i(dsc++)
Durga Devi
 
PPTX
stack_operationss_documentation_file.ppt
l228296
 
PPT
DATA STRUCTURES A BRIEF OVERVIEW OF DATA
LearnItAllAcademy
 
PPTX
DATA STRUCTURE INTRODUCITON FULL NOTES.pptx
Keerthanakeerthana869629
 
PPT
Introduction of data structure in short.ppt
mba29007
 
PPTX
Lect-1.pptx
mrizwan38
 
PPT
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
yarotos643
 
PPTX
1.Introduction to Data Structures and Algorithms.pptx
BlueSwede
 
PDF
Data Structures and Files
KanchanPatil34
 
PPT
1597380885789.ppt
PraveenKumar977108
 
PPT
Data Structures and Algorithm for Engineers.ppt
AdharshKumarSingh
 
PPT
02-dataStructurePM and algortima for python.ppt
totowahid1
 
PPT
Basic Data Structure and its concepts details
baisakhiparida92
 
PPT
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DanilynSukkie
 
PPT
DSA theory all topics (summary) presentation
damru0408
 
chapter three ppt.pptx
selemonGamo
 
Data Structure
Ibrahim MH
 
Stack data structure in Data Structure using C
Meghaj Mallick
 
Introduction to stack
Kavya Shree
 
Unit i(dsc++)
Durga Devi
 
stack_operationss_documentation_file.ppt
l228296
 
DATA STRUCTURES A BRIEF OVERVIEW OF DATA
LearnItAllAcademy
 
DATA STRUCTURE INTRODUCITON FULL NOTES.pptx
Keerthanakeerthana869629
 
Introduction of data structure in short.ppt
mba29007
 
Lect-1.pptx
mrizwan38
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
yarotos643
 
1.Introduction to Data Structures and Algorithms.pptx
BlueSwede
 
Data Structures and Files
KanchanPatil34
 
1597380885789.ppt
PraveenKumar977108
 
Data Structures and Algorithm for Engineers.ppt
AdharshKumarSingh
 
02-dataStructurePM and algortima for python.ppt
totowahid1
 
Basic Data Structure and its concepts details
baisakhiparida92
 
DATA STRUCTURES IN INFORMATION TECHNOLOGY
DanilynSukkie
 
DSA theory all topics (summary) presentation
damru0408
 
Ad

More from Rabin BK (20)

PPTX
Artificial Intelligence in E-commerce
Rabin BK
 
PPTX
Three address code generation
Rabin BK
 
PPTX
Consumer Oriented Application, Mercantile process and Mercantile models
Rabin BK
 
PPTX
Clang compiler `
Rabin BK
 
PPTX
Simple Mail Transfer Protocol
Rabin BK
 
PPTX
HTML text formatting tags
Rabin BK
 
PPTX
Data encryption in database management system
Rabin BK
 
PPTX
Object Relational Database Management System(ORDBMS)
Rabin BK
 
PPTX
Kolmogorov Smirnov
Rabin BK
 
PPTX
Job sequencing in Data Strcture
Rabin BK
 
PPTX
Bluetooth
Rabin BK
 
PPTX
Data Science
Rabin BK
 
PPTX
Graphics_3D viewing
Rabin BK
 
PPTX
Neural Netwrok
Rabin BK
 
PPTX
Watermarking in digital images
Rabin BK
 
PPTX
Heun's Method
Rabin BK
 
PPTX
Mutual Exclusion
Rabin BK
 
PPTX
Systems Usage
Rabin BK
 
PPTX
Manager of a company
Rabin BK
 
PPTX
Profile of Organizations
Rabin BK
 
Artificial Intelligence in E-commerce
Rabin BK
 
Three address code generation
Rabin BK
 
Consumer Oriented Application, Mercantile process and Mercantile models
Rabin BK
 
Clang compiler `
Rabin BK
 
Simple Mail Transfer Protocol
Rabin BK
 
HTML text formatting tags
Rabin BK
 
Data encryption in database management system
Rabin BK
 
Object Relational Database Management System(ORDBMS)
Rabin BK
 
Kolmogorov Smirnov
Rabin BK
 
Job sequencing in Data Strcture
Rabin BK
 
Bluetooth
Rabin BK
 
Data Science
Rabin BK
 
Graphics_3D viewing
Rabin BK
 
Neural Netwrok
Rabin BK
 
Watermarking in digital images
Rabin BK
 
Heun's Method
Rabin BK
 
Mutual Exclusion
Rabin BK
 
Systems Usage
Rabin BK
 
Manager of a company
Rabin BK
 
Profile of Organizations
Rabin BK
 
Ad

Recently uploaded (20)

PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 

Stack Data Structure

  • 1. STACK DATA STRUCTURE 1 Presented by: Rabin BK BSc.CSIT 4th Semester
  • 2.  Introduction  Linear data structure  Stack implementation  References 2
  • 3. Introduction 3  A data structure is a particular way of organizing data in a computer so that it can be used effectively  The idea is to reduce the space and time complexities of different tasks and improve efficiency  A data structure is a specialized format for organizing and storing data.  The linear and non-linear data structure is the subclassification of the data structure The linear data structure arranges the data into a sequence and follow some sort of order. E.g., Array, queue, stack, linked list, etc. The non-linear data structure does not organize the data in a sequential manner. E.g., Tree and graph.
  • 4. Linear data structure 4  The data elements construct a sequence of a linear list.  The elements are adjacently attached to each other and in a specified order.  It consumes linear memory space, the data elements are required to store in a sequential manner in the memory.  It does not make a good utilization of memory and result in memory wastage.  The data element are visited sequentially where only a single element can be directly reached.  The examples included in the linear data structure are array, stack, queue, linked list, etc.
  • 5. Stack 5  Stack is basically a data object  The operational semantic (meaning) of stack is LIFO i.e. last in first out  It is an ordered list of elements n , such that n>0 in which all insertions and deletions are made at one end called the top.  Primary operations defined on a stack:  PUSH : add an element at the top of the list.  POP : remove the at the top of the list.  Also "IsEmpty()" and "IsFull" function, which tests whether a stack is empty or full respectively.
  • 6. Stack 6 Example :  Practical daily life: a pile of heavy books kept in a vertical box, dishes kept one on top of another  In computer world: In processing of subroutine calls and returns; there is an explicit use of stack of return addresses.  Also in evaluation of arithmetic expressions, stack is used.  Large number of stacks can be expressed using a single one dimensional stack only. Such an array is called a multiple stack array.  For all the standard stack operations (push, pop, isEmpty, size), the worst- case run-time complexity can be O(1).  Push and pop are also O(1) because they only work with one end of the data structure - the top of the stack.
  • 7. Stack 7 if(top >= 10) { cout << "Stack Overflow n"; } else { a[++top] = x; cout << "Element Inserted n"; } if(top < 0) { cout << "Stack Underflow n"; return 0; } else { int d = a[top--]; return d; }