SlideShare a Scribd company logo
6
Most read
12
Most read
13
Most read
Department of IT

Presented by-
 Narendra katariya
The stack is a very common and non
   primitive data structure used in
programs. By data structure, I mean
something that is meant to hold data
 and provides certain operations on
              that data.
Abstract definition
• A stack is a fundamental computer
  science data structure and can be defined
  in an abstract, implementation-free
  manner,
• it can be generally defined as,
  Stack is a linear list of items in which all
  additions and deletion are restricted to
  one end that is Top.
Examples of stack
Operations on stack
• a stack is a last in, first out (LIFO) abstract data
  type and Data structure
  In computer science, a data structure is a particular
  way of storing and organizing data in a computer
  so that it can be used efficiently .Different kinds of
  data structures are suited to different kinds of
  applications, and some are highly specialized to
  specific tasks...

   A stack can have any abstract data type as an
  element, but is characterized by only three
  fundamental operations: push, pop and stack top
The basic operations that can be performed
                    on stack:

• Push: The process of adding a new element of
  top of the stack is called push operation.
  Pushing an element In the stack invoke adding
  of element, as the new element will be inserted
  at the top after every push operation the top is
  incremented by one. In case the array is full and
  no new element can be accommodated ,it is
  called stack full condition . This condition is
  called stack overflow.
Pop: the process of deleting an element from the
  Top of the stack is called pop operation. After
  every pop operation the stack is decrement by
  one. If there is no element on the stack and the
  pop is performed then this will result into stack
  underflow condition.
• A common model of a stack is plates in a
  marriage party or coin stacker. Fresh plate are
  “pushed” onto to the top and “popped ” from the
  top.
Stack implementation

                 Stacks


 static array                  dynamic arrays
                          Graphical region
Parenthesis
                          fill
checker
Stack implementation in two way:
• Static implementation: these implementation uses
  arrays to create stack. Static implementation
  though a very simple technique but is not a
  flexible way of creation as the size of stack has
  to be declared during program design after that
  can not be varied. Static implementation is not
  too efficient with respect to memory utilization.
• Dynamic implementation: these implementation is
  also called link list implementation and uses
  pointer to implement the stack type of data
  structure.
Stack Applications
• A Palindrome is a string that reads the same
  in either direction
  – Examples: “Able was I ere I saw Elba”
• Reversing the string
• Implementation of DFS
 - a stack is the proper data structure to
   remember the current node and how to
   backtrack.
Calculation of arithmetic notation

• Infix notation: the infix notetion is what we come
  across our general mathematics, where the
  opereter is written in between the operand.
Example: A+B
• prefix notation: the prefix notation a notation in which
  the operators is written before the operand, it is also
  called polish notation.
Example: +AB
• Postfix notation: in the postfix notation the operators
  are written after the operands, so it’s called the postfix
  notation’ it’s also called suffix notation.
Example :AB+
Thank you

More Related Content

What's hot (20)

PDF
Applications of stack
eShikshak
 
PPT
Stack Data Structure & It's Application
Tech_MX
 
PPTX
Infix to postfix conversion
Then Murugeshwari
 
PDF
Stack
Zaid Shabbir
 
PPTX
Stacks IN DATA STRUCTURES
Sowmya Jyothi
 
PPTX
Stack and its Applications : Data Structures ADT
Soumen Santra
 
PPTX
Stacks and Queue - Data Structures
Dr. Jasmine Beulah Gnanadurai
 
PPT
Stack
srihariyenduri
 
PPTX
Queue ppt
SouravKumar328
 
PPTX
Queues
Ashim Lamichhane
 
PPTX
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Muhammad Hammad Waseem
 
PPTX
Hashing Technique In Data Structures
SHAKOOR AB
 
PPTX
Stack Data Structure
Afaq Mansoor Khan
 
PDF
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Balwant Gorad
 
PPT
Heaps
Hafiz Atif Amin
 
PPT
Infix to Postfix Conversion Using Stack
Soumen Santra
 
PPTX
Doubly Linked List
Ninad Mankar
 
PPSX
Data Structure (Queue)
Adam Mukharil Bachtiar
 
PPTX
Stacks in c++
Vineeta Garg
 
PPTX
Application of Stack - Yadraj Meena
Dipayan Sarkar
 
Applications of stack
eShikshak
 
Stack Data Structure & It's Application
Tech_MX
 
Infix to postfix conversion
Then Murugeshwari
 
Stacks IN DATA STRUCTURES
Sowmya Jyothi
 
Stack and its Applications : Data Structures ADT
Soumen Santra
 
Stacks and Queue - Data Structures
Dr. Jasmine Beulah Gnanadurai
 
Queue ppt
SouravKumar328
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Muhammad Hammad Waseem
 
Hashing Technique In Data Structures
SHAKOOR AB
 
Stack Data Structure
Afaq Mansoor Khan
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Balwant Gorad
 
Infix to Postfix Conversion Using Stack
Soumen Santra
 
Doubly Linked List
Ninad Mankar
 
Data Structure (Queue)
Adam Mukharil Bachtiar
 
Stacks in c++
Vineeta Garg
 
Application of Stack - Yadraj Meena
Dipayan Sarkar
 

Viewers also liked (20)

PPTX
STACKS IN DATASTRUCTURE
Archie Jamwal
 
PPSX
Stack
Seema Sharma
 
PPSX
Stacks Implementation and Examples
greatqadirgee4u
 
PPT
Queue data structure
anooppjoseph
 
PPT
Queue Data Structure
Zidny Nafan
 
PPTX
Data structure Stack
Praveen Vishwakarma
 
PPT
Stack Data Structure V1.0
Zidny Nafan
 
PPSX
Data Structure (Stack)
Adam Mukharil Bachtiar
 
PPT
Application of Stacks
Ain-ul-Moiz Khawaja
 
PPT
Stacks & Queues By Ms. Niti Arora
kulachihansraj
 
PPTX
Stack Data structure
B Liyanage Asanka
 
PPTX
Ppt presentation of queues
Buxoo Abdullah
 
PPT
DATA STRUCTURES
bca2010
 
PPTX
Trees data structure
Sumit Gupta
 
PPT
Queue and stacks
grahamwell
 
PPT
Queue
Nabeel Ahsen
 
PPTX
Tree in data structure
ghhgj jhgh
 
PDF
Tree and binary tree
Zaid Shabbir
 
PDF
Queue as data_structure
eShikshak
 
STACKS IN DATASTRUCTURE
Archie Jamwal
 
Stacks Implementation and Examples
greatqadirgee4u
 
Queue data structure
anooppjoseph
 
Queue Data Structure
Zidny Nafan
 
Data structure Stack
Praveen Vishwakarma
 
Stack Data Structure V1.0
Zidny Nafan
 
Data Structure (Stack)
Adam Mukharil Bachtiar
 
Application of Stacks
Ain-ul-Moiz Khawaja
 
Stacks & Queues By Ms. Niti Arora
kulachihansraj
 
Stack Data structure
B Liyanage Asanka
 
Ppt presentation of queues
Buxoo Abdullah
 
DATA STRUCTURES
bca2010
 
Trees data structure
Sumit Gupta
 
Queue and stacks
grahamwell
 
Tree in data structure
ghhgj jhgh
 
Tree and binary tree
Zaid Shabbir
 
Queue as data_structure
eShikshak
 
Ad

Similar to Stack a Data Structure (20)

PDF
The Stack (Data Structccccccccccccccccccc
parwarsmko98
 
PPTX
STACK AND QUEUE CIRCULAR QUEUE PPTS.pptx
sunitha1792
 
PPTX
5.-Stacks.pptx
iloveyoucarlo0923
 
PPTX
STACK.pptx
Dr.Shweta
 
PPTX
Data Structure - Stacks
Sampad Kar
 
PPT
week 7,8,10,11 alll files included from .ppt
LidetAdmassu
 
PPTX
Unit 3 stack
Dabbal Singh Mahara
 
PPTX
DS-UNIT 3 FINAL.pptx
prakashvs7
 
PPTX
Stack in Sata Structure
Muhazzab Chouhadry
 
PPTX
Stacks Data structure.pptx
line24arts
 
PDF
4-Stack --------------------------------in C++.pdf
ab6399671
 
PPTX
Stack and its operations, Queue and its operations
poongothai11
 
PPTX
Data Structures Stack and Queue Data Structures
poongothai11
 
PPTX
STACK AND ITS OPERATIONS IN DATA STRUCTURES.pptx
KALPANAC20
 
PDF
Data structures stacks
maamir farooq
 
PPT
stack data structure and its applications , advantages, disadvantages etc
rajinooka
 
PPT
stack data structure , applications, advantages
rajinooka
 
PPT
Linear Datsructure_stacks_Data Structure_PPT.ppt
rajinooka
 
PPTX
STACK_IN_DATA STRUCTURE AND ALGORITHMS.pptx
bwubca22582
 
PPT
Stack data structures with definition and code
bansidharj11
 
The Stack (Data Structccccccccccccccccccc
parwarsmko98
 
STACK AND QUEUE CIRCULAR QUEUE PPTS.pptx
sunitha1792
 
5.-Stacks.pptx
iloveyoucarlo0923
 
STACK.pptx
Dr.Shweta
 
Data Structure - Stacks
Sampad Kar
 
week 7,8,10,11 alll files included from .ppt
LidetAdmassu
 
Unit 3 stack
Dabbal Singh Mahara
 
DS-UNIT 3 FINAL.pptx
prakashvs7
 
Stack in Sata Structure
Muhazzab Chouhadry
 
Stacks Data structure.pptx
line24arts
 
4-Stack --------------------------------in C++.pdf
ab6399671
 
Stack and its operations, Queue and its operations
poongothai11
 
Data Structures Stack and Queue Data Structures
poongothai11
 
STACK AND ITS OPERATIONS IN DATA STRUCTURES.pptx
KALPANAC20
 
Data structures stacks
maamir farooq
 
stack data structure and its applications , advantages, disadvantages etc
rajinooka
 
stack data structure , applications, advantages
rajinooka
 
Linear Datsructure_stacks_Data Structure_PPT.ppt
rajinooka
 
STACK_IN_DATA STRUCTURE AND ALGORITHMS.pptx
bwubca22582
 
Stack data structures with definition and code
bansidharj11
 
Ad

More from ForwardBlog Enewzletter (10)

PPT
Sorting searching
ForwardBlog Enewzletter
 
PPTX
Pn junction
ForwardBlog Enewzletter
 
PPT
Feedback amplifiers
ForwardBlog Enewzletter
 
PPTX
Oscillators
ForwardBlog Enewzletter
 
PPTX
Compile time polymorphism
ForwardBlog Enewzletter
 
PPTX
Constructors & destructors
ForwardBlog Enewzletter
 
PPTX
Parameter passing to_functions_in_c
ForwardBlog Enewzletter
 
PPTX
Propositional logic
ForwardBlog Enewzletter
 
PPT
Presentation on graphs
ForwardBlog Enewzletter
 
Sorting searching
ForwardBlog Enewzletter
 
Feedback amplifiers
ForwardBlog Enewzletter
 
Compile time polymorphism
ForwardBlog Enewzletter
 
Constructors & destructors
ForwardBlog Enewzletter
 
Parameter passing to_functions_in_c
ForwardBlog Enewzletter
 
Propositional logic
ForwardBlog Enewzletter
 
Presentation on graphs
ForwardBlog Enewzletter
 

Recently uploaded (20)

PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Dimensions of Societal Planning in Commonism
StefanMz
 

Stack a Data Structure

  • 1. Department of IT Presented by- Narendra katariya
  • 2. The stack is a very common and non primitive data structure used in programs. By data structure, I mean something that is meant to hold data and provides certain operations on that data.
  • 3. Abstract definition • A stack is a fundamental computer science data structure and can be defined in an abstract, implementation-free manner, • it can be generally defined as, Stack is a linear list of items in which all additions and deletion are restricted to one end that is Top.
  • 5. Operations on stack • a stack is a last in, first out (LIFO) abstract data type and Data structure In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently .Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks... A stack can have any abstract data type as an element, but is characterized by only three fundamental operations: push, pop and stack top
  • 6. The basic operations that can be performed on stack: • Push: The process of adding a new element of top of the stack is called push operation. Pushing an element In the stack invoke adding of element, as the new element will be inserted at the top after every push operation the top is incremented by one. In case the array is full and no new element can be accommodated ,it is called stack full condition . This condition is called stack overflow.
  • 7. Pop: the process of deleting an element from the Top of the stack is called pop operation. After every pop operation the stack is decrement by one. If there is no element on the stack and the pop is performed then this will result into stack underflow condition.
  • 8. • A common model of a stack is plates in a marriage party or coin stacker. Fresh plate are “pushed” onto to the top and “popped ” from the top.
  • 9. Stack implementation Stacks static array dynamic arrays Graphical region Parenthesis fill checker
  • 10. Stack implementation in two way: • Static implementation: these implementation uses arrays to create stack. Static implementation though a very simple technique but is not a flexible way of creation as the size of stack has to be declared during program design after that can not be varied. Static implementation is not too efficient with respect to memory utilization. • Dynamic implementation: these implementation is also called link list implementation and uses pointer to implement the stack type of data structure.
  • 11. Stack Applications • A Palindrome is a string that reads the same in either direction – Examples: “Able was I ere I saw Elba” • Reversing the string • Implementation of DFS - a stack is the proper data structure to remember the current node and how to backtrack.
  • 12. Calculation of arithmetic notation • Infix notation: the infix notetion is what we come across our general mathematics, where the opereter is written in between the operand. Example: A+B • prefix notation: the prefix notation a notation in which the operators is written before the operand, it is also called polish notation. Example: +AB • Postfix notation: in the postfix notation the operators are written after the operands, so it’s called the postfix notation’ it’s also called suffix notation. Example :AB+