Professional Documents
Culture Documents
Abstract Data Types: Asim Rehan
Abstract Data Types: Asim Rehan
Asim Rehan
1
Some basic questions
• What is an integer?
– What are the operations that can be performed on
Integers?
• What is a character?
– What are the operations that can be performed on
characters?
Some more basic questions
• How an integer is represented?
– How the integer based operations are performed?
7
Abstract Data Types
Def.
a collection of related data items
together with
an associated set of operations
e.g. whole numbers (integers)
Basic Operations: apply arithmetic operations (addition,
subtraction, multiplication and division)
Why "abstract" ?
Data, operations, and relations are studied independent of
implementation.
9
Data Structure
• A data structure is the physical implementation of an
ADT.
– Each operation associated with the ADT is implemented by one
or more subroutines in the implementation.
10
Data Type
ADT:
Data Items:
Type
Logical Form
Operations
11
Data Structures, Abstract Data Types, and
Implementations