Array-ADT: Slides Taken From Various Resources From Internet
Array-ADT: Slides Taken From Various Resources From Internet
Array-ADT
Definition:
Is a set of data and its associated operation on it
Mathematical abstraction
No implementation detail
ADT is a mathematical model which defines two
things
The type of data and
Its associated operations defined on that data
Abstract Data Types (ADTs)
An abstract data type (ADT) is an
abstraction of a data structure
An ADT specifies:
Data stored
Operations on the data
Error conditions associated with
operations
•4
ADT vs Data Structure
•5
ADT vs Data Structure (contd.)
•6
Array as ADT
•7
algorithm
•1-10
Analysis of algorithms
Issues:
correctness
time efficiency
space efficiency
optimality
Approaches:
empirical analysis
theoretical analysis
Empirical analysis of time
efficiency
Select a specific (typical) sample of inputs
Analyze the empirical data
Use physical unit of time (e.g., milliseconds) or
Of course, we can simply use some standard unit of
time measurement—a second, or millisecond, and so
on—to measure the running time of a program
implementing the algorithm.
Empirical analysis of time efficiency-
•13
cont.
There are obvious drawbacks to such an approach
dependence on the speed of a particular computer
dependence on the quality of a program implementing
the algorithm
the compiler used in generating the machine code
the difficulty of clocking the actual running time of the
program.
Since we are after a measure of an algorithm’s
efficiency, we would like to have a metric that does
not depend on these extraneous factors.
Summary
ADT
ADT vs Data Structure
Empirical Analysis of time efficiency