Coefficient of Thermal Expansion and their Importance.pptx
Abstract Data Types
1. Abstract Data Types (ADT)
• Problem solving with a computer: processing data.
• 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 is a collection of data together with a set of operations on
that data.
ADT = Data + Operations
1
2. Abstract Data Types (ADT)
• The ADT specifies
• What can be stored in the Abstract Data Type
• What operations can be done on/by the Abstract Data Type.
2
The concept of abstraction means:
1. We know what a data type can do.
2. How it is done is hidden.
Definition :
Abstract Data type (ADT) is defined as a mathematical
model with a collection of operations defined on that
model.
3. Abstract Data Types (ADT)
ADT Types
• Simple ADTs
• Predefined data types are Simple
ADTs.
• Examples: int, float, double, char,
bool
• Consider Integer ADT:
• This type of ADT is an integer
with predefined ranges.
• several operations that can be
applied to this data type (addition,
subtraction, multiplication,
division and so on)
3
Integer ADT
….. -3,-2,-1,0,1,2,3….
Data
- Number
- Positive / Negative
Operations
- Addition
- Subtraction
- Multiplication
- Division
Integer ADT
4. Abstract Data Types (ADT)
ADT Types
• Complex ADT:
• While several simple ADTs have been implemented, such as
integer, real, character, pointer and so on, and are available for use
in most languages, many useful complex ADTs are not.
• We need some additional ADTs that should be created and stored
in the library of the computer to be used.
• Example:
• List, Set, Graph, Stack, Queue,etc.,
4
5. Abstract Data Types (ADT)
Data
- Number
- Positive / Negative
Operations
- Addition
- Subtraction
- Multiplication
- Division
Integer ADT
Data
Sequence of elements
Operations
Insert
- Find
- Delete
- Next
- Previous
- Make Empty
- Print list
List ADT
Simple ADTs Complex ADTs
5
6. List ADT
• List is a complex abstract data type that represents a countable
number of ordered values.
• It is an ordered collection of items of some element type.
• It is a widely used data structure for applications which do not need
random access.
• It is basically of the following form :
Note:
– A1 - First Element of the list.
– N - Size of the list.
– Position of is Ai is i.
– Ai+1 succeeds Ai.
– Ai-1 precedes Ai.
A1,A2…….AN(N>=0)
6