DATA STRUCTRES & ALGORITHMS
ABSTRACT DATA TYPES
BY MAYANK BHATT
BY MAYANK BHATT
Abstract Data Types
Abstract Data Type (ADT): a definition for a data type
solely in terms of a set of values and a set of operations on
that data type.
An abstract data type (ADT) is a data type that is organized
in such a way that the specification of the objects and the
operations on the objects is separated from the
representation of the objects and the implementation of the
operations.
Each ADT operation is defined by its inputs and outputs.
Encapsulation: Hide implementation details.
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)—to hide how the
operation is performed on the data.
BY MAYANK BHATT
Abstract Data Types
Abstract Data Abstract Data Type (ADT): a definition
for a data type solely in terms of a set
Type (ADT) of values and a set of operations on
that data type.
Data
Model of a data type
Properties • Data Properties
• Operations that can be performed on data
Operations
BY MAYANK BHATT
Abstract Data Types
Integer ADT Example:
Integer data type
Properties • ….., -3, -2, -1, 0 1, 2, 3, ….
• Number • Add, Subtract, Multiply & divide
• Negative/Positive
Operations
• Addition
• Substraction
• Multiplication
• Division
BY MAYANK BHATT
Abstract Data Types
Example Implementation 1
typedef struct fraction
{
int numerator,
int denominator;
}fraction;
BY MAYANK BHATT
Advantages of ADT
It is language independent.
It prevents the direct manipulation of data values,
except through the defined functions.
It is very important for organizing big software
projects because it partitoins the solution of a
problem into independent parts or modules on
which different persons can work.
The different modules can be used by different
persons for different purposes with small changes.
ADTs encourage modularity of the programming.
By using it, we can change implementation quickly.
BY MAYANK BHATT
Thank
You