ADT specification (1)
Each ADT should have a contract that:
- specifies the set of values of the ADT
- specifies each operation of the ADT(i.e., the operation’s name, parameter type(s), result type, and observable behavior).
The contract does not specify the data representation, nor the algorithms used to implement the operations.
The observable behavior of an operation is its effect as ‘observed’ by the application code.
- Example of observable behavior: search an array.
- Examples of algorithms with that behavior: linear search, binary search.