24A. Abstract Data Types

You have seen the Equivalence Manager. It has a conceptual part, consisting of

  1. a type, Equiv, and

  2. an interface telling just which functions (including merge and equivalent) are provided.

There is also an implementation, consisting of

  1. a way of representing a thing of type Equiv (as an array of bosses), and

  2. definitions of the functions in the interface, plus a definition of a function, leader, that is not part of the interface.

The equivalence manager is an example of an abstract data type (ADT) and the ADT's implementation. In general, an ADT has the following parts.

  1. There is a type. Let's call it T.

  2. The ADT describes what objects of type T are, at a conceptual level.

  3. The ADT also contains an interface listing functions and constants that are available for type T and saying what those functions do in conceptual terms.

An ADT implementation is a way of providing for the ADT in a program. It has the following parts.

  1. There is a representation of objects of type T that tells how those objects are stored in the memory.

  2. There are algorithms for carrying out the functions in the interface, eventually expressed in a programming language. The algorithms usually depend heavily on the data representation.

With this page, we begin to look at an ADT list of integers, an implementation of that ADT and ideas for developing algorithms.