SlideShare a Scribd company logo
Data Structures :Abstract DataType (ADT)
Praseetha E
Assistant Professor
Department of Computer Science&Applications
St. Mary’s College
Thrissur-680020
Kerala
Data Structures,Praseetha E,St.Mary’s College
Abstract Data Type (ADT)
 To process data with a computer, we need to define the data type and
the operation to be performed on the data.
 The definition of the data type and the definition of the operation to
be applied to the data is part of the idea behind an abstract data type
(ADT)
 ADT means to hide how the operation is performed on the data.
 In other words, the user of an ADT needs only to know that a set of
operations are available for the data type, but does not need to know
how they are applied.
Data Structures,Praseetha E,St.Mary’s College
Simple ADTs
 Many programming languages already define some simple ADTs as
integral parts of the language.
 For example, the C language defines a simple ADT as an integer. The
type of this ADT is an integer with predefined ranges.
 C also defines several operations that can be applied to this data type
(addition, subtraction, multiplication, division and so on).
 C explicitly defines these operations on integers and what we expect
as the results. A programmer who writes a C program to add two
integers should know about the integer ADT and the operations that
can be applied to it.
Data Structures,Praseetha E,St.Mary’s College
Complex ADTs
 Although several simple ADTs, such as integer, real, character,
pointer and so on, have been implemented and are available for use in
most languages, many useful complex ADTs are not.
 As we will see in this session, we need a list ADT, a stack ADT, a
queue ADT and so on. To be efficient, these ADTs should be created
and stored in the library of the computer to be used.
Data Structures,Praseetha E,St.Mary’s College
Stack
 A stack is a restricted data structure in which all additions and
deletions are made at one end, the top.
 If we insert a series of data items into a stack and then remove
them, the order of the data is reversed. This reversing attribute is
why stacks are known as last in, first out (LIFO) data structures.
Fig: Three representations of stacks
Data Structures,Praseetha E,St.Mary’s College
Operations on stack
There are two basic operations can be applied to a stack:
 Push operation
 Pop operation
The push operation
The following shows the format.
Fig :Push operation
Data Structures,Praseetha E,St.Mary’s College
The pop operation
The following shows the format.
Fig :Pop operation
 The pop operation deletes the item at the top of the stack.
Data Structures,Praseetha E,St.Mary’s College
Stack: Applications
1.Parsing
2.Recursive Function
3.Expression Evaluation
4.Expression Conversion
1.Infix to Postfix
2.Infix to Prefix
3.Postfix to Infix
4.Prefix to Infix
5.Towers of hanoi
Data Structures,Praseetha E,St.Mary’s College
Queue
 A queue is a linear list in which data can only be inserted at one end,
called the rear, and deleted from the other end, called the front.
 These restrictions ensure that the data is processed through the queue
in the order in which it is received. In other words, a queue is a first
in, first out (FIFO) structure.
Fig: Two representation of queues
Data Structures,Praseetha E,St.Mary’s College
Operations on queue
There are two basic operations that can be applied to a queue:
 Enqueue operation
 Dequeue operation
The enqueue operation
The following shows the enqueue operation:
Fig: The enqueue operation
Data Structures,Praseetha E,St.Mary’s College
The dequeue operation
 The dequeue operation deletes the item at the front of the queue.
The following shows the enqueue operation:
Fig: The dequeue operation
Data Structures,Praseetha E,St.Mary’s College
Queue :Applications
Queue is used when things don’t have to be processed immediately, but
have to be processed in First In First Out order.
1. When a resource is shared among multiple consumers. Examples
include CPU scheduling, Disk Scheduling.
2. When data is transferred asynchronously (data not necessarily
received at same rate as sent) between two processes. Examples
include IO Buffers, pipes, file IO, etc.
Data Structures,Praseetha E,St.Mary’s College
Linked list
 Linked list is a list in which operations, such as insertion and
deletion, can be done anywhere in the list-at the beginning, in the
middle or at the end. Fig. shows a general linked list.
Fig: Linked list
Data Structures,Praseetha E,St.Mary’s College
Operations on Linked list
There are two basic operations that can be applied to a linked list:
 Insert operation
 Delete operation
The insert operation
 Since in a general linked list, insertion can be done in any
position. To determine where the element is to be placed,
searching is needed.
Fig:The insert operation
Data Structures,Praseetha E,St.Mary’s College
The delete operation
 Deletion from a linked list also requires that the list be searched to
locate the data to be deleted. After the location of the data is found,
deletion can be done.
Fig: The dequeue operation
The following shows the Eg:
Data Structures,Praseetha E,St.Mary’s College
Linked list :Applications
1.Implementation of stacks and queues
2.Implementation of graphs : Adjacency list representation of
graphs is most popular which is uses linked list to store
adjacent vertices.
3.Dynamic memory allocation : We use linked list of free
blocks.
4.Performing arithmetic operations on long integers
5.Manipulation of polynomials by storing constants in the node
of linked list
6.Representing sparse matrices
Data Structures,Praseetha E,St.Mary’s College
Tree
 A tree consists of a finite set of elements, called nodes (or
vertices) and a finite set of directed lines, called arcs, that
connect pairs of the nodes.
Fig: Tree representation
Data Structures,Praseetha E,St.Mary’s College
 Each node in a tree may have a subtree. The subtree of each
node includes one of its children and all descendents of that
child.
Figure shows all subtrees for the above tree
Fig: Subtrees
Data Structures,Praseetha E,St.Mary’s College
Operations on tree:
There are three basic operations that can be applied on a tree:
 Insert operation
 Delete operation
 Traversal operation
Data Structures,Praseetha E,St.Mary’s College
Tree traversals
 A tree traversal requires that each node of the tree be processed
once and only once in a predetermined sequence.
There are 3 approaches used in traversing a tree :
Fig: Tree representation
Data Structures,Praseetha E,St.Mary’s College
Tree :Applications
1.Heap is a tree data structure which is implemented using arrays
and used to implement priority queues.
2.B-Tree and B+ Tree : They are used to implement indexing in
databases.
3.Syntax Tree: Used in Compilers.
4.Expression evaluation
Data Structures,Praseetha E,St.Mary’s College
 An arithmetic expression can be represented in three different
formats: infix, postfix and prefix.
 In an infix notation, the operator comes between the two operands.
 In postfix notation, the operator comes after its two operands.
 In prefix notation it comes before the two operands. These formats
are shown below for addition of two operands A and B.
Expression tree
Data Structures,Praseetha E,St.Mary’s College
Fig: Expression tree
Data Structures,Praseetha E,St.Mary’s College
Reference :
“Data Structures and Program Design in C” by Kruse Robert L
“Data Structure Using C” by A K Sharma
“Data structures” by Seymour Lipschutz
Ad

More Related Content

What's hot (20)

Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
karthikeyanC40
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
Elavarasi K
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
Ashish Arun
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
shameen khan
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
Self-Employed
 
Unit 4.1 (tree)
Unit 4.1 (tree)Unit 4.1 (tree)
Unit 4.1 (tree)
DurgaDeviCbit
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
Shubham Dwivedi
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
Dattatray Gandhmal
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
Dharita Chokshi
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
Gyanmanjari Institute Of Technology
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
rprajat007
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
Gurukul Kangri Vishwavidyalaya - Faculty of Engineering and Technology
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
Apurbo Datta
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
Megha yadav
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
Anil Kumar Prajapati
 
Distributed database
Distributed databaseDistributed database
Distributed database
ReachLocal Services India
 
1.1 binary tree
1.1 binary tree1.1 binary tree
1.1 binary tree
Krish_ver2
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
Elavarasi K
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
shameen khan
 
Abstract data types (adt) intro to data structure part 2
Abstract data types (adt)   intro to data structure part 2Abstract data types (adt)   intro to data structure part 2
Abstract data types (adt) intro to data structure part 2
Self-Employed
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
Dharita Chokshi
 
Lecture 1 data structures and algorithms
Lecture 1 data structures and algorithmsLecture 1 data structures and algorithms
Lecture 1 data structures and algorithms
Aakash deep Singhal
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
rprajat007
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
Megha yadav
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
Anil Kumar Prajapati
 

Similar to Computer Science-Data Structures :Abstract DataType (ADT) (20)

Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Nimmi Weeraddana
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
meenamadhuvandhi2
 
Datastructures using c++
Datastructures using c++Datastructures using c++
Datastructures using c++
Gopi Nath
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
ShrushtiGole
 
3rd-Sem_CSE_Data-Structures and Applications.docx
3rd-Sem_CSE_Data-Structures and Applications.docx3rd-Sem_CSE_Data-Structures and Applications.docx
3rd-Sem_CSE_Data-Structures and Applications.docx
harshavardhan543715
 
EC2311 – Data Structures and C Programming
EC2311 – Data Structures and C ProgrammingEC2311 – Data Structures and C Programming
EC2311 – Data Structures and C Programming
Padma Priya
 
database concepts pdf :BEMIT
database concepts pdf :BEMITdatabase concepts pdf :BEMIT
database concepts pdf :BEMIT
Usman Mchinja
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
KPRevathiAsstprofITD
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
Shakila Mahjabin
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMS
AbhishekRajpoot8
 
1introduction-191021211508Algorithms and data structures.pptx
1introduction-191021211508Algorithms and data structures.pptx1introduction-191021211508Algorithms and data structures.pptx
1introduction-191021211508Algorithms and data structures.pptx
smartashammari
 
Data Structures & algorithms kdkdkakdkadkd
Data Structures & algorithms kdkdkakdkadkdData Structures & algorithms kdkdkakdkadkd
Data Structures & algorithms kdkdkakdkadkd
Anji (M.Tech)
 
Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
Ranjithkumar C
 
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptxData_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptxData_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
removed_8057d320f6c8601c14a895598b86eacb
 
Chapter one overview of c++ in algorithm.pptx
Chapter one overview of c++ in algorithm.pptxChapter one overview of c++ in algorithm.pptx
Chapter one overview of c++ in algorithm.pptx
wubieabiye2020
 
Introduction to Data Structure.pptx
Introduction to Data Structure.pptxIntroduction to Data Structure.pptx
Introduction to Data Structure.pptx
GlenardDSarmiento
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
Revathiparamanathan
 
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pdData structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Nimmi Weeraddana
 
Datastructures using c++
Datastructures using c++Datastructures using c++
Datastructures using c++
Gopi Nath
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
ShrushtiGole
 
3rd-Sem_CSE_Data-Structures and Applications.docx
3rd-Sem_CSE_Data-Structures and Applications.docx3rd-Sem_CSE_Data-Structures and Applications.docx
3rd-Sem_CSE_Data-Structures and Applications.docx
harshavardhan543715
 
EC2311 – Data Structures and C Programming
EC2311 – Data Structures and C ProgrammingEC2311 – Data Structures and C Programming
EC2311 – Data Structures and C Programming
Padma Priya
 
database concepts pdf :BEMIT
database concepts pdf :BEMITdatabase concepts pdf :BEMIT
database concepts pdf :BEMIT
Usman Mchinja
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
introduction of database in DBMS
introduction of database in DBMSintroduction of database in DBMS
introduction of database in DBMS
AbhishekRajpoot8
 
1introduction-191021211508Algorithms and data structures.pptx
1introduction-191021211508Algorithms and data structures.pptx1introduction-191021211508Algorithms and data structures.pptx
1introduction-191021211508Algorithms and data structures.pptx
smartashammari
 
Data Structures & algorithms kdkdkakdkadkd
Data Structures & algorithms kdkdkakdkadkdData Structures & algorithms kdkdkakdkadkd
Data Structures & algorithms kdkdkakdkadkd
Anji (M.Tech)
 
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptxData_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptxData_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
aamirali1061a
 
Chapter one overview of c++ in algorithm.pptx
Chapter one overview of c++ in algorithm.pptxChapter one overview of c++ in algorithm.pptx
Chapter one overview of c++ in algorithm.pptx
wubieabiye2020
 
Introduction to Data Structure.pptx
Introduction to Data Structure.pptxIntroduction to Data Structure.pptx
Introduction to Data Structure.pptx
GlenardDSarmiento
 
Ad

More from St Mary's College,Thrissur,Kerala (20)

Creative writing and literature
Creative writing and literature Creative writing and literature
Creative writing and literature
St Mary's College,Thrissur,Kerala
 
Magnetic Tape
Magnetic TapeMagnetic Tape
Magnetic Tape
St Mary's College,Thrissur,Kerala
 
Online Data Storage
Online Data StorageOnline Data Storage
Online Data Storage
St Mary's College,Thrissur,Kerala
 
Mathematics:Cryptography
Mathematics:CryptographyMathematics:Cryptography
Mathematics:Cryptography
St Mary's College,Thrissur,Kerala
 
Mathematics:Arithmetical Functions
Mathematics:Arithmetical FunctionsMathematics:Arithmetical Functions
Mathematics:Arithmetical Functions
St Mary's College,Thrissur,Kerala
 
Physical education :Yoga For Stress Relief
Physical education :Yoga For Stress ReliefPhysical education :Yoga For Stress Relief
Physical education :Yoga For Stress Relief
St Mary's College,Thrissur,Kerala
 
Psychology:PAIN: Types, Theories and Assessment of pain
Psychology:PAIN: Types, Theories and  Assessment of pain Psychology:PAIN: Types, Theories and  Assessment of pain
Psychology:PAIN: Types, Theories and Assessment of pain
St Mary's College,Thrissur,Kerala
 
Economics:Functions
Economics:FunctionsEconomics:Functions
Economics:Functions
St Mary's College,Thrissur,Kerala
 
Mathematics:H-Complexity
Mathematics:H-ComplexityMathematics:H-Complexity
Mathematics:H-Complexity
St Mary's College,Thrissur,Kerala
 
Statistics:Probability Theory
Statistics:Probability TheoryStatistics:Probability Theory
Statistics:Probability Theory
St Mary's College,Thrissur,Kerala
 
Statistics:Fundamentals Of Statistics
Statistics:Fundamentals Of StatisticsStatistics:Fundamentals Of Statistics
Statistics:Fundamentals Of Statistics
St Mary's College,Thrissur,Kerala
 
Economics:Public Revenue
Economics:Public RevenueEconomics:Public Revenue
Economics:Public Revenue
St Mary's College,Thrissur,Kerala
 
Economics:Public Debt
Economics:Public  DebtEconomics:Public  Debt
Economics:Public Debt
St Mary's College,Thrissur,Kerala
 
Economics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And DimensionsEconomics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And Dimensions
St Mary's College,Thrissur,Kerala
 
Economics:Economic Integration
Economics:Economic IntegrationEconomics:Economic Integration
Economics:Economic Integration
St Mary's College,Thrissur,Kerala
 
Economics:Enviornmental Pollution
Economics:Enviornmental Pollution Economics:Enviornmental Pollution
Economics:Enviornmental Pollution
St Mary's College,Thrissur,Kerala
 
Computer Science:JavaScript
Computer Science:JavaScript Computer Science:JavaScript
Computer Science:JavaScript
St Mary's College,Thrissur,Kerala
 
Computer Science:Sql Set Operation
Computer Science:Sql Set OperationComputer Science:Sql Set Operation
Computer Science:Sql Set Operation
St Mary's College,Thrissur,Kerala
 
Computer Science:Java jdbc
Computer Science:Java jdbcComputer Science:Java jdbc
Computer Science:Java jdbc
St Mary's College,Thrissur,Kerala
 
Microbiology:General Principles of Food Preservation
Microbiology:General Principles of Food PreservationMicrobiology:General Principles of Food Preservation
Microbiology:General Principles of Food Preservation
St Mary's College,Thrissur,Kerala
 
Ad

Recently uploaded (20)

Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 

Computer Science-Data Structures :Abstract DataType (ADT)

  • 1. Data Structures :Abstract DataType (ADT) Praseetha E Assistant Professor Department of Computer Science&Applications St. Mary’s College Thrissur-680020 Kerala
  • 2. Data Structures,Praseetha E,St.Mary’s College Abstract Data Type (ADT)  To process data with a computer, we need to define the data type and the operation to be performed on the data.  The definition of the data type and the definition of the operation to be applied to the data is part of the idea behind an abstract data type (ADT)  ADT means to hide how the operation is performed on the data.  In other words, the user of an ADT needs only to know that a set of operations are available for the data type, but does not need to know how they are applied.
  • 3. Data Structures,Praseetha E,St.Mary’s College Simple ADTs  Many programming languages already define some simple ADTs as integral parts of the language.  For example, the C language defines a simple ADT as an integer. The type of this ADT is an integer with predefined ranges.  C also defines several operations that can be applied to this data type (addition, subtraction, multiplication, division and so on).  C explicitly defines these operations on integers and what we expect as the results. A programmer who writes a C program to add two integers should know about the integer ADT and the operations that can be applied to it.
  • 4. Data Structures,Praseetha E,St.Mary’s College Complex ADTs  Although several simple ADTs, such as integer, real, character, pointer and so on, have been implemented and are available for use in most languages, many useful complex ADTs are not.  As we will see in this session, we need a list ADT, a stack ADT, a queue ADT and so on. To be efficient, these ADTs should be created and stored in the library of the computer to be used.
  • 5. Data Structures,Praseetha E,St.Mary’s College Stack  A stack is a restricted data structure in which all additions and deletions are made at one end, the top.  If we insert a series of data items into a stack and then remove them, the order of the data is reversed. This reversing attribute is why stacks are known as last in, first out (LIFO) data structures. Fig: Three representations of stacks
  • 6. Data Structures,Praseetha E,St.Mary’s College Operations on stack There are two basic operations can be applied to a stack:  Push operation  Pop operation The push operation The following shows the format. Fig :Push operation
  • 7. Data Structures,Praseetha E,St.Mary’s College The pop operation The following shows the format. Fig :Pop operation  The pop operation deletes the item at the top of the stack.
  • 8. Data Structures,Praseetha E,St.Mary’s College Stack: Applications 1.Parsing 2.Recursive Function 3.Expression Evaluation 4.Expression Conversion 1.Infix to Postfix 2.Infix to Prefix 3.Postfix to Infix 4.Prefix to Infix 5.Towers of hanoi
  • 9. Data Structures,Praseetha E,St.Mary’s College Queue  A queue is a linear list in which data can only be inserted at one end, called the rear, and deleted from the other end, called the front.  These restrictions ensure that the data is processed through the queue in the order in which it is received. In other words, a queue is a first in, first out (FIFO) structure. Fig: Two representation of queues
  • 10. Data Structures,Praseetha E,St.Mary’s College Operations on queue There are two basic operations that can be applied to a queue:  Enqueue operation  Dequeue operation The enqueue operation The following shows the enqueue operation: Fig: The enqueue operation
  • 11. Data Structures,Praseetha E,St.Mary’s College The dequeue operation  The dequeue operation deletes the item at the front of the queue. The following shows the enqueue operation: Fig: The dequeue operation
  • 12. Data Structures,Praseetha E,St.Mary’s College Queue :Applications Queue is used when things don’t have to be processed immediately, but have to be processed in First In First Out order. 1. When a resource is shared among multiple consumers. Examples include CPU scheduling, Disk Scheduling. 2. When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. Examples include IO Buffers, pipes, file IO, etc.
  • 13. Data Structures,Praseetha E,St.Mary’s College Linked list  Linked list is a list in which operations, such as insertion and deletion, can be done anywhere in the list-at the beginning, in the middle or at the end. Fig. shows a general linked list. Fig: Linked list
  • 14. Data Structures,Praseetha E,St.Mary’s College Operations on Linked list There are two basic operations that can be applied to a linked list:  Insert operation  Delete operation The insert operation  Since in a general linked list, insertion can be done in any position. To determine where the element is to be placed, searching is needed. Fig:The insert operation
  • 15. Data Structures,Praseetha E,St.Mary’s College The delete operation  Deletion from a linked list also requires that the list be searched to locate the data to be deleted. After the location of the data is found, deletion can be done. Fig: The dequeue operation The following shows the Eg:
  • 16. Data Structures,Praseetha E,St.Mary’s College Linked list :Applications 1.Implementation of stacks and queues 2.Implementation of graphs : Adjacency list representation of graphs is most popular which is uses linked list to store adjacent vertices. 3.Dynamic memory allocation : We use linked list of free blocks. 4.Performing arithmetic operations on long integers 5.Manipulation of polynomials by storing constants in the node of linked list 6.Representing sparse matrices
  • 17. Data Structures,Praseetha E,St.Mary’s College Tree  A tree consists of a finite set of elements, called nodes (or vertices) and a finite set of directed lines, called arcs, that connect pairs of the nodes. Fig: Tree representation
  • 18. Data Structures,Praseetha E,St.Mary’s College  Each node in a tree may have a subtree. The subtree of each node includes one of its children and all descendents of that child. Figure shows all subtrees for the above tree Fig: Subtrees
  • 19. Data Structures,Praseetha E,St.Mary’s College Operations on tree: There are three basic operations that can be applied on a tree:  Insert operation  Delete operation  Traversal operation
  • 20. Data Structures,Praseetha E,St.Mary’s College Tree traversals  A tree traversal requires that each node of the tree be processed once and only once in a predetermined sequence. There are 3 approaches used in traversing a tree : Fig: Tree representation
  • 21. Data Structures,Praseetha E,St.Mary’s College Tree :Applications 1.Heap is a tree data structure which is implemented using arrays and used to implement priority queues. 2.B-Tree and B+ Tree : They are used to implement indexing in databases. 3.Syntax Tree: Used in Compilers. 4.Expression evaluation
  • 22. Data Structures,Praseetha E,St.Mary’s College  An arithmetic expression can be represented in three different formats: infix, postfix and prefix.  In an infix notation, the operator comes between the two operands.  In postfix notation, the operator comes after its two operands.  In prefix notation it comes before the two operands. These formats are shown below for addition of two operands A and B. Expression tree
  • 23. Data Structures,Praseetha E,St.Mary’s College Fig: Expression tree
  • 24. Data Structures,Praseetha E,St.Mary’s College Reference : “Data Structures and Program Design in C” by Kruse Robert L “Data Structure Using C” by A K Sharma “Data structures” by Seymour Lipschutz