Abstract Data Types


The terms Abstract and Abstraction defined:

Other important definitions:

Categories of Operations

  1. Constructors - Functions that create an abstract data type. Example: int x; or new node(); Also the constructor function in a C++ class.
  2. Transformers (mutators) - Functions that change the data in some way. Example: x = 3; The equals function sets the value store in the variable x. This may include setting values, inserting or deleting an item from an object, combining two objects (binary transformer -- example x = 2 + 3; plus (+) is the binary transformer insert() or delete() in an ADT change the data stored.
  3. Observers - Functions that allow us to observe the state of one or more of the data values
    1. Predicates -- asks if a certain property is true, example: isEmpty();
    2. Accessor or selector -- returns a copy of a data object, example: getX();
    3. Summary -- return information about the object as a whole, example: getListLength();
  4. Iterators - Functions that perform some sequential action on all data components in an object. Example: setAll(value);