SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptxApplication of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptxPrakash Zodge
 
Linked List - Insertion & Deletion
Linked List - Insertion & DeletionLinked List - Insertion & Deletion
Linked List - Insertion & DeletionAfaq Mansoor Khan
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionarynitamhaske
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in pythonhydpy
 
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary fileCBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary fileShivaniJayaprakash1
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked listsAbdullah Al-hazmy
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURESStacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURESSowmya Jyothi
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]Muhammad Hammad Waseem
 
Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methodsnarmadhakin
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure Janki Shah
 
Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queuesBuxoo Abdullah
 

Tendances (20)

Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptxApplication of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
Application of Stack For Expression Evaluation by Prakash Zodge DSY 41.pptx
 
Linked List - Insertion & Deletion
Linked List - Insertion & DeletionLinked List - Insertion & Deletion
Linked List - Insertion & Deletion
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Chapter8 my sql revision tour
Chapter8 my sql revision tourChapter8 my sql revision tour
Chapter8 my sql revision tour
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
 
12 SQL
12 SQL12 SQL
12 SQL
 
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary fileCBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
CBSE - Class 12 - Ch -5 -File Handling , access mode,CSV , Binary file
 
List in Python
List in PythonList in Python
List in Python
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked lists
 
Stacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURESStacks IN DATA STRUCTURES
Stacks IN DATA STRUCTURES
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methods
 
Stack
StackStack
Stack
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
Chapter 14 strings
Chapter 14 stringsChapter 14 strings
Chapter 14 strings
 
Python programming : Files
Python programming : FilesPython programming : Files
Python programming : Files
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queues
 
Stack a Data Structure
Stack a Data StructureStack a Data Structure
Stack a Data Structure
 

Similaire à 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 By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arorakulachihansraj
 
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
 

Similaire à 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 By Ms. Niti Arora
Stacks & Queues By Ms. Niti AroraStacks & Queues By Ms. Niti Arora
Stacks & Queues By Ms. Niti Arora
 
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.
 

Dernier

Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjurptikerjasaptiker
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schscnajjemba
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...nirzagarg
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1ranjankumarbehera14
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
SR-101-01012024-EN.docx  Federal Constitution  of the Swiss ConfederationSR-101-01012024-EN.docx  Federal Constitution  of the Swiss Confederation
SR-101-01012024-EN.docx Federal Constitution of the Swiss ConfederationEfruzAsilolu
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样wsppdmt
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制vexqp
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...gajnagarg
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制vexqp
 

Dernier (20)

Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling ManjurJual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
Jual Cytotec Asli Obat Aborsi No. 1 Paling Manjur
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
SR-101-01012024-EN.docx  Federal Constitution  of the Swiss ConfederationSR-101-01012024-EN.docx  Federal Constitution  of the Swiss Confederation
SR-101-01012024-EN.docx Federal Constitution of the Swiss Confederation
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 

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.