Operation on stack
Stack (LIFO)last in first
out.
Linear collection of data
elements.
Insertion and deletion
take place only at one
end(TOP).
Insertion operation is
There are two operations
implement on stack:-
1. Push(insert)
2. Pop(delete)
 Deletion operation is called
pop operation in stack.
 Stack is restricted kind of
data structure.
 Ex:-
To add a new element in
stack . This operation is
called push in stack . If we
want to push element in
stack first of all we have to
check condition “overflow”.
Overflow means if TOP of
stack is equal to MAXSTACK
and we want to add new
element into a stack then a
condition “overflow” is occur.
ex:- Here
top=5
Maxstk =5
So” overflow condition
occur”
10
20
30
40
50
1
2
3
4
5
To remove existing element
from stack . This operation is
called pop in stack . If we want
to pop element in stack first of
all we have to check condition
“underflow”.
Underflow means if top=0
or top=null and we want to
delete element from stack
then the condition
“underflow” is occur. Ex:-
Here
Top=0
Maxstk =5
So condition “underflow”
Occur.
1
2
3
4
5
Thanks

More Related Content

PPTX
STACKS IN DATASTRUCTURE
PPT
Stack Operation In Data Structure
PPT
Stacks
PPT
Stack Data Structure V1.0
PPT
PPSX
PPTX
Stack and its Applications : Data Structures ADT
PPTX
Data structure by Digvijay
STACKS IN DATASTRUCTURE
Stack Operation In Data Structure
Stacks
Stack Data Structure V1.0
Stack and its Applications : Data Structures ADT
Data structure by Digvijay

What's hot (20)

PDF
STACK ( LIFO STRUCTURE) - Data Structure
PPTX
Application of Stack - Yadraj Meena
PPT
Stack application
PPT
PPTX
Stacks in DATA STRUCTURE
PPTX
Stacks in Data Structure
PPTX
Stack_Application_Infix_Prefix.pptx
PPT
03 stacks and_queues_using_arrays
PPTX
Project of data structure
PPTX
Stack and queue
PPTX
Stack - Data Structure
PPTX
Stack Data Structure
PPT
stack and queue array implementation in java.
PPT
Stack Data Structure & It's Application
PPT
PPTX
Stacks in c++
PPT
PPTX
Stack data structure
PPT
Data structure lecture7
STACK ( LIFO STRUCTURE) - Data Structure
Application of Stack - Yadraj Meena
Stack application
Stacks in DATA STRUCTURE
Stacks in Data Structure
Stack_Application_Infix_Prefix.pptx
03 stacks and_queues_using_arrays
Project of data structure
Stack and queue
Stack - Data Structure
Stack Data Structure
stack and queue array implementation in java.
Stack Data Structure & It's Application
Stacks in c++
Stack data structure
Data structure lecture7
Ad

Similar to Operation on stack (20)

PDF
XIICSSTACK_INTRODUCTION cs
PPTX
Data structure Stack
PPTX
stack_ppt_DSA(sudipta samanta).pptx push,pop,peek operation
PDF
The Stack (Data Structccccccccccccccccccc
PPTX
Stack operation
PPTX
STACK_IN_DATA STRUCTURE AND ALGORITHMS.pptx
PPT
Lect 15-16 Zaheer Abbas
PPTX
stack data structure jnv chandrpur maharastra.pptx
PPTX
Stack and its operation implemented with array new - Copy.pptx
PPTX
Stack operation algorithms with example
PDF
4-Stack --------------------------------in C++.pdf
PPTX
Stack PPT.pptx
PPTX
STACK.pptx
PDF
PPTX
5.-Stacks.pptx
PDF
Stack push pop
PPTX
Stack data structure class 12 cbse 2024.pptx
PDF
STACK WITH ITS DIFFERENT OPERATIONS .
PPTX
Data structure day3
PPTX
XIICSSTACK_INTRODUCTION cs
Data structure Stack
stack_ppt_DSA(sudipta samanta).pptx push,pop,peek operation
The Stack (Data Structccccccccccccccccccc
Stack operation
STACK_IN_DATA STRUCTURE AND ALGORITHMS.pptx
Lect 15-16 Zaheer Abbas
stack data structure jnv chandrpur maharastra.pptx
Stack and its operation implemented with array new - Copy.pptx
Stack operation algorithms with example
4-Stack --------------------------------in C++.pdf
Stack PPT.pptx
STACK.pptx
5.-Stacks.pptx
Stack push pop
Stack data structure class 12 cbse 2024.pptx
STACK WITH ITS DIFFERENT OPERATIONS .
Data structure day3
Ad

Recently uploaded (20)

PDF
Laparoscopic Imaging Systems at World Laparoscopy Hospital
PPTX
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
PDF
Unleashing the Potential of the Cultural and creative industries
PDF
Physical pharmaceutics two in b pharmacy
PPTX
MMW-CHAPTER-1-final.pptx major Elementary Education
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PDF
Global strategy and action plan on oral health 2023 - 2030.pdf
PDF
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
PPTX
Neurology of Systemic disease all systems
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
PDF
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
PPTX
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
PPTX
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
PPT
hsl powerpoint resource goyloveh feb 07.ppt
PDF
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
PDF
Developing speaking skill_learning_mater.pdf
PPTX
GW4 BioMed Candidate Support Webinar 2025
PPTX
Copy of ARAL Program Primer_071725(1).pptx
PDF
GSA-Past-Papers-2010-2024-2.pdf CSS examination
PDF
FAMILY PLANNING (preventative and social medicine pdf)
Laparoscopic Imaging Systems at World Laparoscopy Hospital
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
Unleashing the Potential of the Cultural and creative industries
Physical pharmaceutics two in b pharmacy
MMW-CHAPTER-1-final.pptx major Elementary Education
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
Global strategy and action plan on oral health 2023 - 2030.pdf
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
Neurology of Systemic disease all systems
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
hsl powerpoint resource goyloveh feb 07.ppt
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
Developing speaking skill_learning_mater.pdf
GW4 BioMed Candidate Support Webinar 2025
Copy of ARAL Program Primer_071725(1).pptx
GSA-Past-Papers-2010-2024-2.pdf CSS examination
FAMILY PLANNING (preventative and social medicine pdf)

Operation on stack

  • 2. Stack (LIFO)last in first out. Linear collection of data elements. Insertion and deletion take place only at one end(TOP). Insertion operation is
  • 3. There are two operations implement on stack:- 1. Push(insert) 2. Pop(delete)
  • 4.  Deletion operation is called pop operation in stack.  Stack is restricted kind of data structure.  Ex:-
  • 5. To add a new element in stack . This operation is called push in stack . If we want to push element in stack first of all we have to check condition “overflow”.
  • 6. Overflow means if TOP of stack is equal to MAXSTACK and we want to add new element into a stack then a condition “overflow” is occur. ex:- Here top=5 Maxstk =5 So” overflow condition occur” 10 20 30 40 50 1 2 3 4 5
  • 7. To remove existing element from stack . This operation is called pop in stack . If we want to pop element in stack first of all we have to check condition “underflow”.
  • 8. Underflow means if top=0 or top=null and we want to delete element from stack then the condition “underflow” is occur. Ex:- Here Top=0 Maxstk =5 So condition “underflow” Occur. 1 2 3 4 5