4
Most read
12
Most read
14
Most read
STACK
STACK
• Common Example :
• Suppose at your home you have multiple chairs then you put them
together to form a vertical pile. From that vertical pile the chair which is
placed last is always removed first.
Chair which was placed first is removed last. In this way we can see how
stack is related to us.
What is Stack ?
• Stack is used as Linear data structure which can be
accessed from only one end .
• Stack is LIFO Structure [ Last in First Out ]
• Stack is Ordered List of Elements of Same Type.
• Stack is Linear List
• In Stack Operations such as Insertion of an element
is called PUSH and Deletion of an element is called
POP. Both operations permitted at only one end
called Top
Representation of Stack in Memory
Representation of Stack in Memory The stack
• The stack can be implemented into two ways:
◦ Using arrays (Static implementation)
◦ Using pointer (Dynamic implementation)
implementation)Representation of Stack in
Memory The stack can be implemented into two
ways: ◦ Using arrays (Static implementation) ◦
Using pointer (Dynamic implementation)
Visual Representation of Stack :
• View 1 : When Stack is Empty
When Stack is said to empty then it does not contain any element inside it.
Whenever the Stack is Empty the position of topmost element is -1.
• View 2 : When Stack is Not Empty
• Whenever we add very first element then topmost position will be
incremented by 1. After adding First Element top = 0.
• View 3 :
• After Deletion of 1 Element Top Will be Decremented by 1
Operations on Stack
Representation of Stack in Memory The stack
• PUSH:
 It adds a new element to the top of the stack.
 After every push operation top of stack incremented by
one.
 If stack is full no new element can be accommodated,
this condition is called stack overflow or stack is full.
Operations on Stack
Representation of Stack in Memory The stack
• POP: I
 It removes the top element from the stack.):
 After every pop operation top of stack decremented by
one.
 If stack is empty and pop operation performed this will
result into stack underflow condition or stack empty.
he stack
Array Representation of Stack in C
Programming :
• 1-D array is used to hold the element of the
stack.
• Variable “top” keeps track of “Topmost”
Element in the stack.
• “MAXSIZE” is used as Constant which gives
maximum size of Stack.
stack, opeartions on stack, applications of stack
PUSH operation on stack
POP operation on stack
APPLICATION OF THE STACK
1. Mathematical Expression Evaluation
2. Expression conversion
a.Infix to Postfix.
b.Infix to Prefix.
c.Postfix to Infix.
d.Prefix to Infix.
3.Parsing
4.Simulation of recursion
5.Function call and recursion
5. Stack frame
6. Reversing a String

More Related Content

PPTX
stack
PPTX
Stack - Data Structure
PPTX
Data structure Stack
PPTX
STACK.pptx
PPSX
Data structure stack&queue basics
PPTX
My lectures circular queue
PPTX
DATA STRUCTURE - STACK
PPT
04 data mining : data generelization
stack
Stack - Data Structure
Data structure Stack
STACK.pptx
Data structure stack&queue basics
My lectures circular queue
DATA STRUCTURE - STACK
04 data mining : data generelization

What's hot (20)

PPSX
Data Structure (Stack)
PPSX
PDF
302 B+Tree Ind Hash
PPTX
8 Array
PDF
PPTX
Stack_Application_Infix_Prefix.pptx
PPTX
Introduction to stack
PPT
Application of Stacks
PPTX
Stack Data Structure
PPT
Stacks overview with its applications
PPT
Stacks
PPTX
Stacks in c++
PPTX
Data structure and its types
PDF
Stacks,queues,linked-list
PPT
Difference between stack and queue
PDF
Linear search
PPTX
PDF
DS UNIT 1.pdf
PPTX
Strings in c#
Data Structure (Stack)
302 B+Tree Ind Hash
8 Array
Stack_Application_Infix_Prefix.pptx
Introduction to stack
Application of Stacks
Stack Data Structure
Stacks overview with its applications
Stacks
Stacks in c++
Data structure and its types
Stacks,queues,linked-list
Difference between stack and queue
Linear search
DS UNIT 1.pdf
Strings in c#
Ad

Similar to stack, opeartions on stack, applications of stack (20)

PDF
The Stack (Data Structccccccccccccccccccc
PDF
STACK ( LIFO STRUCTURE) - Data Structure
PPTX
Stack and its operations
PPTX
Data structure by Digvijay
DOCX
Stacks in data structure
PPT
Stack a Data Structure
PPT
Lect 15-16 Zaheer Abbas
PPTX
STACK.pptx
PPTX
Lecture#5 - Stack ADT.pptx
PPTX
stack_ppt_DSA(sudipta samanta).pptx push,pop,peek operation
PDF
4-Stack --------------------------------in C++.pdf
PPTX
The presentation on stack data structure
PDF
XIICSSTACK_INTRODUCTION cs
PDF
PDF
Stack concepts by Divya
PDF
04 stacks
PPTX
Stack PPT.pptx
PDF
Chapter 5 Stack and Queue.pdf
PDF
PPTX
Data Structure ARRAY REPRESENTATION OF STACKS
The Stack (Data Structccccccccccccccccccc
STACK ( LIFO STRUCTURE) - Data Structure
Stack and its operations
Data structure by Digvijay
Stacks in data structure
Stack a Data Structure
Lect 15-16 Zaheer Abbas
STACK.pptx
Lecture#5 - Stack ADT.pptx
stack_ppt_DSA(sudipta samanta).pptx push,pop,peek operation
4-Stack --------------------------------in C++.pdf
The presentation on stack data structure
XIICSSTACK_INTRODUCTION cs
Stack concepts by Divya
04 stacks
Stack PPT.pptx
Chapter 5 Stack and Queue.pdf
Data Structure ARRAY REPRESENTATION OF STACKS
Ad

More from Minakshee Patil (18)

PPTX
Introduction, characteristics, Pseudocode.pptx
PPTX
0-1_knapsack_using_Dynamic Programming.pptx
PPTX
Introduction to Computational Complexity Theory pptx
PPTX
Different Searching and Sorting Methods.pptx
PPTX
Analysis of Algorithms (1).pptx, asymptotic
PPTX
0-1_knapsack_using_DP, types of knapsack
PPT
Linear Data Structures, array, stack, queue
PPTX
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
PPTX
Algorithm Design Techiques, divide and conquer
PPTX
Analysis of Algorithms, recurrence relation, solving recurrences
PPT
Lecture2 (9).ppt
PPTX
oracle.pptx
PPT
Lecture1.ppt
PPT
Unit 1.ppt
PPTX
Hierarchical clustering algorithm.pptx
PPT
Lecture2 (1).ppt
PPT
Lecture3 (3).ppt
PPT
Lecture4.ppt
Introduction, characteristics, Pseudocode.pptx
0-1_knapsack_using_Dynamic Programming.pptx
Introduction to Computational Complexity Theory pptx
Different Searching and Sorting Methods.pptx
Analysis of Algorithms (1).pptx, asymptotic
0-1_knapsack_using_DP, types of knapsack
Linear Data Structures, array, stack, queue
Unit 5-BACKTRACKING- n queens, sum of subset, graph coloring problems
Algorithm Design Techiques, divide and conquer
Analysis of Algorithms, recurrence relation, solving recurrences
Lecture2 (9).ppt
oracle.pptx
Lecture1.ppt
Unit 1.ppt
Hierarchical clustering algorithm.pptx
Lecture2 (1).ppt
Lecture3 (3).ppt
Lecture4.ppt

Recently uploaded (20)

PPTX
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
PDF
1.-fincantieri-investor-presentation2.pdf
PPTX
Downstream processing_in Module1_25.pptx
PDF
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
PDF
August 2025 Top read articles in International Journal of Database Managemen...
PPTX
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
PDF
COMPARATIVE ANALYSIS REPORT BY NDIDIAMAKA .G. ISRAEL
PPTX
Cloud Security and Privacy-Module-1.pptx
PPTX
L1111-Important Microbial Mechanisms.pptx
PPTX
non conventional energy resorses material unit-1
PPTX
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
PPTX
5-2d2b20afbe-basic-concepts-of-mechanics.ppt
PPTX
Unit I - Mechatronics.pptx presentation
PPTX
module 2 renewable energy power plant.pptx
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPT
Basics Of Pump types, Details, and working principles.
PDF
CBCN cam bien cong nghiep bach khoa da năng
PPT
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
PPT
linux chapter 1 learning operating system
PDF
Recent Trends in Network Security - 2025
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
1.-fincantieri-investor-presentation2.pdf
Downstream processing_in Module1_25.pptx
The Journal of Finance - July 1993 - JENSEN - The Modern Industrial Revolutio...
August 2025 Top read articles in International Journal of Database Managemen...
MODULE 3 SUSTAINABLE DEVELOPMENT GOALSPPT.pptx
COMPARATIVE ANALYSIS REPORT BY NDIDIAMAKA .G. ISRAEL
Cloud Security and Privacy-Module-1.pptx
L1111-Important Microbial Mechanisms.pptx
non conventional energy resorses material unit-1
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
5-2d2b20afbe-basic-concepts-of-mechanics.ppt
Unit I - Mechatronics.pptx presentation
module 2 renewable energy power plant.pptx
B461227.pdf American Journal of Multidisciplinary Research and Review
Basics Of Pump types, Details, and working principles.
CBCN cam bien cong nghiep bach khoa da năng
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
linux chapter 1 learning operating system
Recent Trends in Network Security - 2025

stack, opeartions on stack, applications of stack

  • 2. STACK • Common Example : • Suppose at your home you have multiple chairs then you put them together to form a vertical pile. From that vertical pile the chair which is placed last is always removed first. Chair which was placed first is removed last. In this way we can see how stack is related to us.
  • 3. What is Stack ? • Stack is used as Linear data structure which can be accessed from only one end . • Stack is LIFO Structure [ Last in First Out ] • Stack is Ordered List of Elements of Same Type. • Stack is Linear List • In Stack Operations such as Insertion of an element is called PUSH and Deletion of an element is called POP. Both operations permitted at only one end called Top
  • 4. Representation of Stack in Memory Representation of Stack in Memory The stack • The stack can be implemented into two ways: ◦ Using arrays (Static implementation) ◦ Using pointer (Dynamic implementation) implementation)Representation of Stack in Memory The stack can be implemented into two ways: ◦ Using arrays (Static implementation) ◦ Using pointer (Dynamic implementation)
  • 5. Visual Representation of Stack : • View 1 : When Stack is Empty When Stack is said to empty then it does not contain any element inside it. Whenever the Stack is Empty the position of topmost element is -1.
  • 6. • View 2 : When Stack is Not Empty • Whenever we add very first element then topmost position will be incremented by 1. After adding First Element top = 0.
  • 7. • View 3 : • After Deletion of 1 Element Top Will be Decremented by 1
  • 8. Operations on Stack Representation of Stack in Memory The stack • PUSH:  It adds a new element to the top of the stack.  After every push operation top of stack incremented by one.  If stack is full no new element can be accommodated, this condition is called stack overflow or stack is full.
  • 9. Operations on Stack Representation of Stack in Memory The stack • POP: I  It removes the top element from the stack.):  After every pop operation top of stack decremented by one.  If stack is empty and pop operation performed this will result into stack underflow condition or stack empty. he stack
  • 10. Array Representation of Stack in C Programming : • 1-D array is used to hold the element of the stack. • Variable “top” keeps track of “Topmost” Element in the stack. • “MAXSIZE” is used as Constant which gives maximum size of Stack.
  • 14. APPLICATION OF THE STACK 1. Mathematical Expression Evaluation 2. Expression conversion a.Infix to Postfix. b.Infix to Prefix. c.Postfix to Infix. d.Prefix to Infix. 3.Parsing 4.Simulation of recursion 5.Function call and recursion 5. Stack frame 6. Reversing a String