Abstract Data Type
When one search for a tool, he needn’t know how the tool have been implemented but only to know how to use and what he can get.
ADT is a package of the declarations of a data type and the operations that are meaningful to it.
We encapsulate the data type and the operations and hide them from the user.
That is to say, ADTs are implementation independent.
- Definition of values
- Condition (optional)
- Definition of operations
- Header (type and name of the function)
- Precondition (opt.)
Data abstraction is an important method is program design.
Algorithms can be designed in terms of the ADT.
(There should be a table of phase to solve a problem)
- Pass by Value
int Square(int x);
- Pass by Reference
int Square(int *x); // actually, this one may create a new pointer variable
int Square(int &x);
Question: the security of