Revised STACK in Python XII CS
Revised STACK in Python XII CS
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.
LINKED
STACK QUEUE TREE HASHMAP GRAPH
LIST
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.
27 32 45 10
10 45 32 27
27
32 32 32
45 45 45 45 45
10 10 10 10 10 10 10
Empty PUSH PUSH PUSH PUSH POP POP POP POP POP
STACK 10 45 32 27
STACK
UNDERFLOW
Empty Stack
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.