SlideShare a Scribd company logo
8
Most read
9
Most read
10
Most read
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.
Revised Data Structure- STACK in Python XII CS.pdf
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
Revised Data Structure- STACK in Python XII CS.pdf
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
Revised Data Structure- STACK in Python XII CS.pdf
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

PPTX
Linux booting Process
PPTX
Introduction to python for Beginners
PDF
CBSE XII Communication And Network Concepts
PPTX
Linux Boot Process
PPTX
Chapter 08 data file handling
PDF
GREEN SKILLS PPT.ppt.pdf
PPTX
computer networks presentation
PPT
Introduction to CSS
Linux booting Process
Introduction to python for Beginners
CBSE XII Communication And Network Concepts
Linux Boot Process
Chapter 08 data file handling
GREEN SKILLS PPT.ppt.pdf
computer networks presentation
Introduction to CSS

What's hot (20)

PDF
Python revision tour II
PPTX
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
PPTX
Chapter 16 Dictionaries
PDF
Python revision tour i
PDF
Data structure ppt
PDF
CBSE XII Database Concepts And MySQL Presentation
PDF
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
PPTX
C language ppt
PPTX
Computer System Overview Class XI CS
PPTX
Python Functions
PPTX
Functions in python
PPTX
Loops in C Programming Language
PPTX
Arrays in Data Structure and Algorithm
PDF
Strings in python
PPTX
Linked list
PDF
Python exception handling
PPTX
Data types in C
PPTX
Templates in c++
PPTX
Chapter 02 functions -class xii
PPT
Constraints In Sql
Python revision tour II
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
Chapter 16 Dictionaries
Python revision tour i
Data structure ppt
CBSE XII Database Concepts And MySQL Presentation
Class XII-UNIT III - SQL and MySQL Notes_0.pdf
C language ppt
Computer System Overview Class XI CS
Python Functions
Functions in python
Loops in C Programming Language
Arrays in Data Structure and Algorithm
Strings in python
Linked list
Python exception handling
Data types in C
Templates in c++
Chapter 02 functions -class xii
Constraints In Sql
Ad

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

PPTX
Stack data structure class 12 cbse 2024.pptx
PPTX
Abscddnddmdkwkkstack implementation.pptx
PDF
stack 1.pdf
PPTX
TSAT Presentation1.pptx
PPT
Difference between stack and queue
PPTX
data structures with algorithms vtu 2023 notes.pptx
PPT
Intro ds
PDF
Data-structures7 class xii ashdshd hfuidshfkjhjsa ioh
DOC
Data Structure
PPTX
Data -structures for class 12 , easy ppt
PPTX
Stack and queue power point presentation data structure and algorithms Stack-...
PPTX
DATA STRUCTURES Unit III.pptxctxt8xtxt8xtct8xtdtict
PPT
Unit i(dsc++)
PPTX
STACK, LINKED LIST ,AND QUEUE
PPTX
stack data structure jnv chandrpur maharastra.pptx
PPT
Stacks & Queues
PPT
Stacks & Queues By Ms. Niti Arora
PPTX
Introduction to stack
PPTX
Stacks – Implementation of stack using array and Linked List – Applications o...
PPTX
Stack and Queue by M.Gomathi Lecturer
Stack data structure class 12 cbse 2024.pptx
Abscddnddmdkwkkstack implementation.pptx
stack 1.pdf
TSAT Presentation1.pptx
Difference between stack and queue
data structures with algorithms vtu 2023 notes.pptx
Intro ds
Data-structures7 class xii ashdshd hfuidshfkjhjsa ioh
Data Structure
Data -structures for class 12 , easy ppt
Stack and queue power point presentation data structure and algorithms Stack-...
DATA STRUCTURES Unit III.pptxctxt8xtxt8xtct8xtdtict
Unit i(dsc++)
STACK, LINKED LIST ,AND QUEUE
stack data structure jnv chandrpur maharastra.pptx
Stacks & Queues
Stacks & Queues By Ms. Niti Arora
Introduction to stack
Stacks – Implementation of stack using array and Linked List – Applications o...
Stack and Queue by M.Gomathi Lecturer
Ad

Recently uploaded (20)

PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
Database Infoormation System (DBIS).pptx
PPTX
Introduction to machine learning and Linear Models
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PDF
Lecture1 pattern recognition............
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PDF
.pdf is not working space design for the following data for the following dat...
PDF
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
PPTX
1_Introduction to advance data techniques.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
annual-report-2024-2025 original latest.
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
oil_refinery_comprehensive_20250804084928 (1).pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Business Ppt On Nestle.pptx huunnnhhgfvu
Database Infoormation System (DBIS).pptx
Introduction to machine learning and Linear Models
Acceptance and paychological effects of mandatory extra coach I classes.pptx
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Lecture1 pattern recognition............
IBA_Chapter_11_Slides_Final_Accessible.pptx
.pdf is not working space design for the following data for the following dat...
TRAFFIC-MANAGEMENT-AND-ACCIDENT-INVESTIGATION-WITH-DRIVING-PDF-FILE.pdf
1_Introduction to advance data techniques.pptx
Supervised vs unsupervised machine learning algorithms
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
annual-report-2024-2025 original latest.
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx

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.
  • 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
  • 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
  • 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.