SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
ESIT137: Fundamentals of Data Structure
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423603
(An Autonomous Institute Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Information Technology
(UG Programme - NBAAccredited)
Dr. M.A. Jawale
Professor and Head, Dept. of IT
Stack & Queue
➢ Stack
▪ Introduction to Stack,
▪ Stack ADT,
▪ Implementation of Stack using array,
▪ Concept of implicit and explicit stack.
➢ References
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
Stack
➢ Stack is a linear data structure in which all additions and deletions are restricted
one end, called the top.
➢ If you insert a data series into a stack and then remove it, the order of the data is
revered. Data input as {5,10,15,20} is removed as {20,15,10,5}.
➢ This reversing attribute is why stacks are known as the LIFO (Last In First Out)
data structure.
➢ There are many real-life examples of a stack. Consider an example of plates
stacked over one another in the canteen. The plate which is at the top is the first
one to be removed, So, it can be simply seen to follow LIFO (Last In First Out)
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
Continue….
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
Basic Operations on Stack
➢ push() : To insert an element into the stack. If the stack is full, then it is said to be
an Overflow condition.
➢ pop() : To remove an element from the stack. If the stack is empty, then it is said
to be an Underflow condition.
➢ top() : Returns the top element of the stack.
➢ isEmpty() : Returns true if stack is empty else false.
➢ size() : Returns the size of stack.
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
Implementation of Stack
➢ The basic operations that can be performed on a stack include push, pop, and top.
➢ There are two ways to implement a stack:
▪ Using array
▪ Using linked list
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
Reference
1. Richard F. Gilberg & Behrouz A. Forouzan, “Data Structures: A Pseudocode
Approach with C, Second Edition”, Cengage Learning.
2. Ellis Horowitz, Sartaj Sahani, Susan Anderson-Freed “Fundamentals of Data
Structures in C”, Universities Press, 2008.
Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology

More Related Content

PDF
Sorting Algorithms: Bubble Sort, Selection Sort,
Dr. Madhuri Jawale
 
PDF
Stack Applications : Infix to postfix conversion, Evaluation of postfix expre...
Dr. Madhuri Jawale
 
PDF
Insertion Sort, Merge Sort. Time complexity of all sorting algorithms and t...
Dr. Madhuri Jawale
 
PPTX
Searching and Sorting Unit II Part I.pptx
Dr. Madhuri Jawale
 
PPTX
Fundamentals of Data Structure_Unit I.pptx
Dr. Madhuri Jawale
 
PDF
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
prasadmutkule1
 
PPTX
ITE Course Unit 1Productivity Tools For An Engineers
NitinShelake4
 
PPTX
Unit 1- Python- Features, Variables, Data Types, Operators and Expressions
GawaliSwapnali13
 
Sorting Algorithms: Bubble Sort, Selection Sort,
Dr. Madhuri Jawale
 
Stack Applications : Infix to postfix conversion, Evaluation of postfix expre...
Dr. Madhuri Jawale
 
Insertion Sort, Merge Sort. Time complexity of all sorting algorithms and t...
Dr. Madhuri Jawale
 
Searching and Sorting Unit II Part I.pptx
Dr. Madhuri Jawale
 
Fundamentals of Data Structure_Unit I.pptx
Dr. Madhuri Jawale
 
ESIT135 Problem Solving Using Python Notes of Unit-1 and Unit-2
prasadmutkule1
 
ITE Course Unit 1Productivity Tools For An Engineers
NitinShelake4
 
Unit 1- Python- Features, Variables, Data Types, Operators and Expressions
GawaliSwapnali13
 

What's hot (20)

PPTX
Unit4-Basic Concepts and methods of Dictionary.pptx
SwapnaliGawali5
 
PDF
ESIT135 Problem Solving Using Python Notes of Unit-3
prasadmutkule1
 
PDF
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
 
PPTX
ESIT135: Unit 3 Topic: functions in python
SwapnaliGawali5
 
PPTX
list.pptx
SwapnaliGawali5
 
PPTX
JAVASRIPT and PHP (Hypertext Preprocessor)
shelakenitinit
 
PPTX
Unit-4 Basic Concepts of Tuple in Python .pptx
SwapnaliGawali5
 
PPT
Introduction to data structures and Algorithm
Dhaval Kaneria
 
PPTX
JAVASRIPT and PHP Basics# Unit 2 Webdesign
NitinShelake4
 
PPTX
ESIT135 : Unit 1 Python Basics Concepts
SwapnaliGawali5
 
PPTX
Binary search tree
Kousalya M
 
PDF
Data structure
Prof. Dr. K. Adisesha
 
PDF
Data structure
Shahariar limon
 
PPT
Unit 3 Tree chapter 5
DrkhanchanaR
 
PPTX
sorting and its types
SIVASHANKARIRAJAN
 
PPT
Stacks
Malainine Zaid
 
PDF
Unit 2_3 Binary Tree Traversals.pdf
KanchanPatil34
 
PPTX
YZM 2116 - Bölüm 3 - Listeler
Deniz KILINÇ
 
PPTX
Ppt on Linked list,stack,queue
Srajan Shukla
 
Unit4-Basic Concepts and methods of Dictionary.pptx
SwapnaliGawali5
 
ESIT135 Problem Solving Using Python Notes of Unit-3
prasadmutkule1
 
ESIT135 Problem Solving Using Python Notes of Unit-2 and Unit-3
prasadmutkule1
 
ESIT135: Unit 3 Topic: functions in python
SwapnaliGawali5
 
list.pptx
SwapnaliGawali5
 
JAVASRIPT and PHP (Hypertext Preprocessor)
shelakenitinit
 
Unit-4 Basic Concepts of Tuple in Python .pptx
SwapnaliGawali5
 
Introduction to data structures and Algorithm
Dhaval Kaneria
 
JAVASRIPT and PHP Basics# Unit 2 Webdesign
NitinShelake4
 
ESIT135 : Unit 1 Python Basics Concepts
SwapnaliGawali5
 
Binary search tree
Kousalya M
 
Data structure
Prof. Dr. K. Adisesha
 
Data structure
Shahariar limon
 
Unit 3 Tree chapter 5
DrkhanchanaR
 
sorting and its types
SIVASHANKARIRAJAN
 
Unit 2_3 Binary Tree Traversals.pdf
KanchanPatil34
 
YZM 2116 - Bölüm 3 - Listeler
Deniz KILINÇ
 
Ppt on Linked list,stack,queue
Srajan Shukla
 
Ad

Similar to Introduction to Stack, ▪ Stack ADT, ▪ Implementation of Stack using array, ▪ Concept of implicit and explicit stack. (20)

PDF
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
Balwant Gorad
 
PPTX
Stack in C.pptx
RituSarkar7
 
PPTX
Stack Data Structure
Rabin BK
 
PPTX
Stacks.pptx in software engineering in simple understanding
MohammedAnas871930
 
PPTX
Data Structures - Lecture 2 - Unit 2.pptx
DanielNesaKumarC
 
DOC
Data Structure
Ibrahim MH
 
PPTX
Stacks and Queue,Concept of Stack,LIFO,Fifo,
shaikhdaniyal8603
 
PDF
DSA Lab Manual C Scheme.pdf
Bharati Vidyapeeth COE, Navi Mumbai
 
PPTX
STACKS implimentarions AND stack applications .pptx
Dr. Amna Mohamed
 
PPTX
Stacks in Data Structure
Lovely Professional University
 
PPTX
Data Structures Stack and Queue Data Structures
poongothai11
 
PPTX
Stack and Queue
Selvaraj Seerangan
 
PPTX
Stack & Queue
Hasan Mahadi Riaz
 
PPT
Unit i(dsc++)
Durga Devi
 
PPSX
Data structure stack&queue basics
Selvin Josy Bai Somu
 
PPTX
Stack and its operations, Queue and its operations
poongothai11
 
PDF
Stacks
Shivam Singh
 
PPTX
Stack data structure class 12 cbse 2024.pptx
PradeepVithule
 
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
Balwant Gorad
 
Stack in C.pptx
RituSarkar7
 
Stack Data Structure
Rabin BK
 
Stacks.pptx in software engineering in simple understanding
MohammedAnas871930
 
Data Structures - Lecture 2 - Unit 2.pptx
DanielNesaKumarC
 
Data Structure
Ibrahim MH
 
Stacks and Queue,Concept of Stack,LIFO,Fifo,
shaikhdaniyal8603
 
DSA Lab Manual C Scheme.pdf
Bharati Vidyapeeth COE, Navi Mumbai
 
STACKS implimentarions AND stack applications .pptx
Dr. Amna Mohamed
 
Stacks in Data Structure
Lovely Professional University
 
Data Structures Stack and Queue Data Structures
poongothai11
 
Stack and Queue
Selvaraj Seerangan
 
Stack & Queue
Hasan Mahadi Riaz
 
Unit i(dsc++)
Durga Devi
 
Data structure stack&queue basics
Selvin Josy Bai Somu
 
Stack and its operations, Queue and its operations
poongothai11
 
Stacks
Shivam Singh
 
Stack data structure class 12 cbse 2024.pptx
PradeepVithule
 
Ad

Recently uploaded (20)

PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
demidovs1
 
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Ppt for engineering students application on field effect
lakshmi.ec
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
demidovs1
 
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Software Testing Tools - names and explanation
shruti533256
 
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 

Introduction to Stack, ▪ Stack ADT, ▪ Implementation of Stack using array, ▪ Concept of implicit and explicit stack.

  • 1. ESIT137: Fundamentals of Data Structure Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423603 (An Autonomous Institute Affiliated to Savitribai Phule Pune University, Pune) NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Information Technology (UG Programme - NBAAccredited) Dr. M.A. Jawale Professor and Head, Dept. of IT
  • 2. Stack & Queue ➢ Stack ▪ Introduction to Stack, ▪ Stack ADT, ▪ Implementation of Stack using array, ▪ Concept of implicit and explicit stack. ➢ References Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
  • 3. Stack ➢ Stack is a linear data structure in which all additions and deletions are restricted one end, called the top. ➢ If you insert a data series into a stack and then remove it, the order of the data is revered. Data input as {5,10,15,20} is removed as {20,15,10,5}. ➢ This reversing attribute is why stacks are known as the LIFO (Last In First Out) data structure. ➢ There are many real-life examples of a stack. Consider an example of plates stacked over one another in the canteen. The plate which is at the top is the first one to be removed, So, it can be simply seen to follow LIFO (Last In First Out) Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
  • 4. Continue…. Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
  • 5. Basic Operations on Stack ➢ push() : To insert an element into the stack. If the stack is full, then it is said to be an Overflow condition. ➢ pop() : To remove an element from the stack. If the stack is empty, then it is said to be an Underflow condition. ➢ top() : Returns the top element of the stack. ➢ isEmpty() : Returns true if stack is empty else false. ➢ size() : Returns the size of stack. Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
  • 6. Implementation of Stack ➢ The basic operations that can be performed on a stack include push, pop, and top. ➢ There are two ways to implement a stack: ▪ Using array ▪ Using linked list Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology
  • 7. Reference 1. Richard F. Gilberg & Behrouz A. Forouzan, “Data Structures: A Pseudocode Approach with C, Second Edition”, Cengage Learning. 2. Ellis Horowitz, Sartaj Sahani, Susan Anderson-Freed “Fundamentals of Data Structures in C”, Universities Press, 2008. Unit-III: Part-I Stack & Queue Dr. Madhuri Jawale Department of Information Technology