SlideShare a Scribd company logo
17. DS, Stacks Types of DS.pdf
It’s a physical implementation that clearly defines a way of storing, accessing
and manipulating data.
Data Structure
Types of D.S.
1. Simple Data Structures are built from primitive data types like integers,
characters, booleans.
e.g. : Arrays & Lists
2. Compound Data Structures are made by combining simple data
structures in different ways.
Linear Data Structures Non Linear Data Structures
i. Tree
ii. Graph
iii. etc.
i. Stack
ii. Queue
iii. Linked List
Linear List Arrays
Arrays refer to a named list of a finite number n of same type of elements.
Arrays can be one dimensional, two-dimensional or multi-dimensional.
0 1 2 3 4 5
8 0 1 3 4 2
Stacks
Last In First Out
Insertion & Deletion both
takes place at the top.
There’s a special way to store lists where we use LIFO technique.
Linked List
As the name suggests, it’s a list like implementation where elements are
linked.
DATA DATA
Stores the value stores the address of next node
12&
120
49&
haus
bbcc
N
U
L
L
Trees are multilevel data structures having a hierarchical relationship
among its elements.
In a linked list, each node stores data & address of next node.
In a Tree, each node stores data & address(es) of child node(s).
Trees
4
5
2
1
2
1
1. Insertion means adding new data element.
2. Deletion means deleting some data element.
3. Searching means finding(maybe index) of some data.
4. Traversal means walking in all elements.
5. Sorting means arranging elements in some order.
6. Merging means combining similar DS.
Operations on DS DS
Stacks
Last In First Out
Insertion & Deletion both
takes place at the top.
There’s a special way to store lists where we use LIFO technique.
Stacks
5
4
5
7
4
5
4
5
8
4
5
13
8
4
5
13
8
4
5
S S S S S S S
8
4
5
8
4
5
4
5 5
S S S S
Stacks
13
8
4
5
3
13
8
4
5
3
13
8
4
5
13
8
4
5
8
4
5
4
5 5
S S S S S S S S S
To implement a stack we need to make its functions.
1. isEmpty(s)
2. Push(s,i)
3. Pop(s)
4. Peek(s)
5. Display(s)
Implementing Stack
‘Ghantu’
‘Mintu’
‘Pintu’
‘Chintu’
We need to maintain top of stack, and make it None when stack is empty.
STACK IMPLEMENT CODE

More Related Content

PPTX
Data Structure using c language for beginners
PDF
2. Introduction to Data Structure.pdf
PPT
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
PPTX
DataStructurePpt.pptx
PPTX
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
PPTX
DataStructureccvdgddfffdesddsssdssPpt.pptx
PPTX
DataStructurePpt.pptx
PDF
.DATA STRUCTURES
Data Structure using c language for beginners
2. Introduction to Data Structure.pdf
ARRAYS IN C++ CBSE AND STATE +2 COMPUTER SCIENCE
DataStructurePpt.pptx
ntroduction of Algorithms, Analysing Algorithms. Arrays: Sparse Matrices - Re...
DataStructureccvdgddfffdesddsssdssPpt.pptx
DataStructurePpt.pptx
.DATA STRUCTURES

Similar to 17. DS, Stacks Types of DS.pdf (20)

PPTX
DataStructurePpt-01.pptxEngineering data structure notes
PDF
Introduction to Data Structure
PPTX
Data structures
PPTX
Data structure & algorithms introduction
PPTX
Unit-1 DataStructure Intro.pptx
PPTX
DSA - Copy.pptx
PPTX
DS Module 1.pptx
PPTX
DS Module 1.pptx
PPTX
Classification of datastructure.ppt
PPT
Introduction to Data structures and Trees.ppt
PPTX
Data Structure and Algorithms by Sabeen Memon03.pptx
PDF
Data Structure Ppt for our engineering college industrial training.
PPT
Data structure lecture 1
PPTX
Data structure
DOCX
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
PPTX
unit 1.pptx
PPTX
data structure
PPTX
DATA STRUCTURE
PDF
UNITIII LDS.pdf
PPTX
Data Structure Introduction- Arrays, Matrix, Linked List
DataStructurePpt-01.pptxEngineering data structure notes
Introduction to Data Structure
Data structures
Data structure & algorithms introduction
Unit-1 DataStructure Intro.pptx
DSA - Copy.pptx
DS Module 1.pptx
DS Module 1.pptx
Classification of datastructure.ppt
Introduction to Data structures and Trees.ppt
Data Structure and Algorithms by Sabeen Memon03.pptx
Data Structure Ppt for our engineering college industrial training.
Data structure lecture 1
Data structure
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
unit 1.pptx
data structure
DATA STRUCTURE
UNITIII LDS.pdf
Data Structure Introduction- Arrays, Matrix, Linked List

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
1_English_Language_Set_2.pdf probationary
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Trump Administration's workforce development strategy
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
RMMM.pdf make it easy to upload and study
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Indian roads congress 037 - 2012 Flexible pavement
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Paper A Mock Exam 9_ Attempt review.pdf.
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
202450812 BayCHI UCSC-SV 20250812 v17.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
1_English_Language_Set_2.pdf probationary
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Trump Administration's workforce development strategy
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
UNIT III MENTAL HEALTH NURSING ASSESSMENT

17. DS, Stacks Types of DS.pdf

  • 2. It’s a physical implementation that clearly defines a way of storing, accessing and manipulating data. Data Structure
  • 3. Types of D.S. 1. Simple Data Structures are built from primitive data types like integers, characters, booleans. e.g. : Arrays & Lists 2. Compound Data Structures are made by combining simple data structures in different ways. Linear Data Structures Non Linear Data Structures i. Tree ii. Graph iii. etc. i. Stack ii. Queue iii. Linked List
  • 4. Linear List Arrays Arrays refer to a named list of a finite number n of same type of elements. Arrays can be one dimensional, two-dimensional or multi-dimensional. 0 1 2 3 4 5 8 0 1 3 4 2
  • 5. Stacks Last In First Out Insertion & Deletion both takes place at the top. There’s a special way to store lists where we use LIFO technique.
  • 6. Linked List As the name suggests, it’s a list like implementation where elements are linked. DATA DATA Stores the value stores the address of next node 12& 120 49& haus bbcc N U L L
  • 7. Trees are multilevel data structures having a hierarchical relationship among its elements. In a linked list, each node stores data & address of next node. In a Tree, each node stores data & address(es) of child node(s). Trees 4 5 2 1 2 1
  • 8. 1. Insertion means adding new data element. 2. Deletion means deleting some data element. 3. Searching means finding(maybe index) of some data. 4. Traversal means walking in all elements. 5. Sorting means arranging elements in some order. 6. Merging means combining similar DS. Operations on DS DS
  • 9. Stacks Last In First Out Insertion & Deletion both takes place at the top. There’s a special way to store lists where we use LIFO technique.
  • 10. Stacks 5 4 5 7 4 5 4 5 8 4 5 13 8 4 5 13 8 4 5 S S S S S S S 8 4 5 8 4 5 4 5 5 S S S S
  • 12. To implement a stack we need to make its functions. 1. isEmpty(s) 2. Push(s,i) 3. Pop(s) 4. Peek(s) 5. Display(s) Implementing Stack ‘Ghantu’ ‘Mintu’ ‘Pintu’ ‘Chintu’ We need to maintain top of stack, and make it None when stack is empty.