SlideShare a Scribd company logo
1 of 15
Download to read offline
Know Python Bytes
w w w . k n o w p y t h o n b y t e s . b l o g s p o t . c o m
Mrs. Payal Bhattacharjee, PGT(C.Sc.)
K V No.1 Kanchrapara
KVS-RO(Kolkata)
S T A C K
UNIT-1 (Revised syllabus) XII CS
COMPUTATIONAL THINKING AND PROGRAMMING-II
Chapter: Data Structure: STACK
C O N T E N T S ( L EA R N I N G O U TCO M ES )
2 0 2 2 - 2 3
Data-structures:
➢ Lists as covered in Class XI,
➢ Stacks – Push, Pop using a list.
What is a Data Structure?
• Data Structures are a way of organizing, accessing and storing data
more efficiently in a program depending upon the situation. Data
Structures are fundamentals of any programming language around
which a program is built.
Why Data structures in Python is easy?
• Python helps to learn the fundamental of these data structures in a
simpler way as compared to other programming languages.
OPERATIONS ON DATA STRUCTURES
CREATION : Creating/Defining a data structure as per requirement
INSERTION : Adding/Inserting a new element or data
DELETION : Delete/Remove an existing element or data
SEARCHING : Search for the specified element or data
TRAVERSAL : Access / Process all the elements or data
SORTING : Arrange/Organize elements in ascending/descending order
MERGING : Merge/Combine elements of two or more data structures of the same type.
DATA STRUCTURES IN
PYTHON
BUILT-IN DATA
STRUCTURES
LIST TUPLE SETS DICTIONARY
USER-DEFINED
DATA STRUCTURES
STACK QUEUE TREE HASHMAP
LINKED
LIST
GRAPH
DATA STRUCTURE : STACK
STACK: Stack is a linear data structure in which the elements can be added or removed only from one end known as “Top” of the stack.
The discipline of Stack is LIFO (Last In First Out) i.e. element inserted last will be removed first. Or, we can say First In Last Out.
Whereas in a LIST, we can add or delete any element from any position.
REAL LIFE APPLICATION OF STACK
The stack of trays in a cafeteria or plates in a cupboard
Stack of Books or copies
Stack of coins
Stack of Bags / Clothes / Chairs
Some Applications of a stack are:
1.Converting infix to postfix expressions.
2.Undo/Redo button/operation in word processors.
3.Syntaxes in languages are parsed using stacks.
4.It is used in many virtual machines like JVM (Java Virtual Machine).
5.History of visited websites.
6.Message logs and all messages you get are arranged in a stack.
7.Call logs, E-mails, Google photos’ any gallery, YouTube downloads, Notifications ( latest appears first ).
8.Scratch card’s earned after Google pay transaction.
9.Wearing/Removing Bangles, Pile of Dinner Plates, Stacked chairs.
10.Recursion.
11.Used in IDEs to check for proper parentheses matching
12.Media playlist. T o play previous and next song
Operation on Stack:
The basic operations on stack is defined as:
❑ Push- addition of new element on the top of stack.
We are going to implement List as a Stack, so, to add element , we have to use append( ) method of List.
❑ Pop – deletion of element from the top.
We are going to implement List as a Stack, so, to remove the top element , we have to use pop( ) method of List.
❑ isEmpty - indicates whether any elements are stored in the stack or not (underflow).
Empty
STACK
10
45
10
32
45
10
27
32
45
10
27
32
45
10
32
45
10
PUSH
10
PUSH
45
PUSH
32
PUSH
27
PUSH
15
POP
STACK
OVERFLOW
10 45 32 27
27
45
10
POP
32
STACK
UNDERFLOW
Empty Stack
10
POP
45
POP
10
POP
OUTPUT
QUESTION FROM QBANK (THEORY)
Bibliograhy and References
• Google
• Wikipedia
• Quora
• geeksforgeeks
• Book: XII Computer Science
• By Sumita Arora, Dhanpat Rai Publication 2020 Edition
Stay safe. Stay aware. Stay healthy. Stay alert.
Revised Data Structure- STACK in Python XII CS.pdf

More Related Content

What's hot

What's hot (20)

12 SQL
12 SQL12 SQL
12 SQL
 
Searching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data StructureSearching and Sorting Techniques in Data Structure
Searching and Sorting Techniques in Data Structure
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
 
Stacks and Queue - Data Structures
Stacks and Queue - Data StructuresStacks and Queue - Data Structures
Stacks and Queue - Data Structures
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Strings in python
Strings in pythonStrings in python
Strings in python
 
Linear Search Presentation
Linear Search PresentationLinear Search Presentation
Linear Search Presentation
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Linked list
Linked listLinked list
Linked list
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 
Linked lists
Linked listsLinked lists
Linked lists
 
1.5 binary search tree
1.5 binary search tree1.5 binary search tree
1.5 binary search tree
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Stacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
 
Vectors in Java
Vectors in JavaVectors in Java
Vectors in Java
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSA
 

Similar to Revised Data Structure- STACK in Python XII CS.pdf

stack 1.pdf
stack 1.pdfstack 1.pdf
stack 1.pdfhafsa40
 
Difference between stack and queue
Difference between stack and queueDifference between stack and queue
Difference between stack and queuePulkitmodi1998
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 
STACK, LINKED LIST ,AND QUEUE
STACK, LINKED LIST ,AND QUEUESTACK, LINKED LIST ,AND QUEUE
STACK, LINKED LIST ,AND QUEUEDev Chauhan
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queuestech4us
 
Introduction to stack
Introduction to stack Introduction to stack
Introduction to stack Kavya Shree
 
Stack and Queue by M.Gomathi Lecturer
Stack and Queue by M.Gomathi LecturerStack and Queue by M.Gomathi Lecturer
Stack and Queue by M.Gomathi Lecturergomathi chlm
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data StructureRabin BK
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Hassan Ahmed
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptxselemonGamo
 
Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9Getachew Ganfur
 
Data structure , stack , queue
Data structure , stack , queueData structure , stack , queue
Data structure , stack , queueRajkiran Nadar
 
Ds
DsDs
DsAcad
 

Similar to Revised Data Structure- STACK in Python XII CS.pdf (20)

stack 1.pdf
stack 1.pdfstack 1.pdf
stack 1.pdf
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Difference between stack and queue
Difference between stack and queueDifference between stack and queue
Difference between stack and queue
 
Intro ds
Intro dsIntro ds
Intro ds
 
Data Structure
Data Structure Data Structure
Data Structure
 
Unit i(dsc++)
Unit i(dsc++)Unit i(dsc++)
Unit i(dsc++)
 
STACK, LINKED LIST ,AND QUEUE
STACK, LINKED LIST ,AND QUEUESTACK, LINKED LIST ,AND QUEUE
STACK, LINKED LIST ,AND QUEUE
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
 
Introduction to stack
Introduction to stack Introduction to stack
Introduction to stack
 
Stack and Queue by M.Gomathi Lecturer
Stack and Queue by M.Gomathi LecturerStack and Queue by M.Gomathi Lecturer
Stack and Queue by M.Gomathi Lecturer
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
 
chapter three ppt.pptx
chapter three ppt.pptxchapter three ppt.pptx
chapter three ppt.pptx
 
Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9
 
Rana Junaid Rasheed
Rana Junaid RasheedRana Junaid Rasheed
Rana Junaid Rasheed
 
Stack in C.pptx
Stack in C.pptxStack in C.pptx
Stack in C.pptx
 
04 stacks
04 stacks04 stacks
04 stacks
 
Data structure , stack , queue
Data structure , stack , queueData structure , stack , queue
Data structure , stack , queue
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
Ds
DsDs
Ds
 

Recently uploaded

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxellehsormae
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxaleedritatuxx
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfBoston Institute of Analytics
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queensdataanalyticsqueen03
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGIThomas Poetter
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024Timothy Spann
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...ssuserf63bd7
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 

Recently uploaded (20)

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
Vision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptxVision, Mission, Goals and Objectives ppt..pptx
Vision, Mission, Goals and Objectives ppt..pptx
 
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptxmodul pembelajaran robotic Workshop _ by Slidesgo.pptx
modul pembelajaran robotic Workshop _ by Slidesgo.pptx
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdfPredicting Salary Using Data Science: A Comprehensive Analysis.pdf
Predicting Salary Using Data Science: A Comprehensive Analysis.pdf
 
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
9711147426✨Call In girls Gurgaon Sector 31. SCO 25 escort service
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
Top 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In QueensTop 5 Best Data Analytics Courses In Queens
Top 5 Best Data Analytics Courses In Queens
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGILLMs, LMMs, their Improvement Suggestions and the Path towards AGI
LLMs, LMMs, their Improvement Suggestions and the Path towards AGI
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
April 2024 - NLIT Cloudera Real-Time LLM Streaming 2024
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
Statistics, Data Analysis, and Decision Modeling, 5th edition by James R. Eva...
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 

Revised Data Structure- STACK in Python XII CS.pdf

  • 1. Know Python Bytes w w w . k n o w p y t h o n b y t e s . b l o g s p o t . c o m Mrs. Payal Bhattacharjee, PGT(C.Sc.) K V No.1 Kanchrapara KVS-RO(Kolkata) S T A C K
  • 2. UNIT-1 (Revised syllabus) XII CS COMPUTATIONAL THINKING AND PROGRAMMING-II Chapter: Data Structure: STACK C O N T E N T S ( L EA R N I N G O U TCO M ES ) 2 0 2 2 - 2 3 Data-structures: ➢ Lists as covered in Class XI, ➢ Stacks – Push, Pop using a list.
  • 3.
  • 4. What is a Data Structure? • Data Structures are a way of organizing, accessing and storing data more efficiently in a program depending upon the situation. Data Structures are fundamentals of any programming language around which a program is built. Why Data structures in Python is easy? • Python helps to learn the fundamental of these data structures in a simpler way as compared to other programming languages.
  • 5. OPERATIONS ON DATA STRUCTURES CREATION : Creating/Defining a data structure as per requirement INSERTION : Adding/Inserting a new element or data DELETION : Delete/Remove an existing element or data SEARCHING : Search for the specified element or data TRAVERSAL : Access / Process all the elements or data SORTING : Arrange/Organize elements in ascending/descending order MERGING : Merge/Combine elements of two or more data structures of the same type.
  • 6. DATA STRUCTURES IN PYTHON BUILT-IN DATA STRUCTURES LIST TUPLE SETS DICTIONARY USER-DEFINED DATA STRUCTURES STACK QUEUE TREE HASHMAP LINKED LIST GRAPH
  • 7.
  • 8. DATA STRUCTURE : STACK STACK: Stack is a linear data structure in which the elements can be added or removed only from one end known as “Top” of the stack. The discipline of Stack is LIFO (Last In First Out) i.e. element inserted last will be removed first. Or, we can say First In Last Out. Whereas in a LIST, we can add or delete any element from any position. REAL LIFE APPLICATION OF STACK The stack of trays in a cafeteria or plates in a cupboard Stack of Books or copies Stack of coins Stack of Bags / Clothes / Chairs Some Applications of a stack are: 1.Converting infix to postfix expressions. 2.Undo/Redo button/operation in word processors. 3.Syntaxes in languages are parsed using stacks. 4.It is used in many virtual machines like JVM (Java Virtual Machine). 5.History of visited websites. 6.Message logs and all messages you get are arranged in a stack. 7.Call logs, E-mails, Google photos’ any gallery, YouTube downloads, Notifications ( latest appears first ). 8.Scratch card’s earned after Google pay transaction. 9.Wearing/Removing Bangles, Pile of Dinner Plates, Stacked chairs. 10.Recursion. 11.Used in IDEs to check for proper parentheses matching 12.Media playlist. T o play previous and next song
  • 9. Operation on Stack: The basic operations on stack is defined as: ❑ Push- addition of new element on the top of stack. We are going to implement List as a Stack, so, to add element , we have to use append( ) method of List. ❑ Pop – deletion of element from the top. We are going to implement List as a Stack, so, to remove the top element , we have to use pop( ) method of List. ❑ isEmpty - indicates whether any elements are stored in the stack or not (underflow). Empty STACK 10 45 10 32 45 10 27 32 45 10 27 32 45 10 32 45 10 PUSH 10 PUSH 45 PUSH 32 PUSH 27 PUSH 15 POP STACK OVERFLOW 10 45 32 27 27 45 10 POP 32 STACK UNDERFLOW Empty Stack 10 POP 45 POP 10 POP
  • 10.
  • 13. Bibliograhy and References • Google • Wikipedia • Quora • geeksforgeeks • Book: XII Computer Science • By Sumita Arora, Dhanpat Rai Publication 2020 Edition
  • 14. Stay safe. Stay aware. Stay healthy. Stay alert.