1 2 3 4 5 6 7 8 9 10 11

Returning to Allen Supynuk's C++ and OOP Notes Why Abstract Data Types (ADTs)?

Abstract Data Types (ADTs)are a higher level way of looking at programming.
Prototypical ADTs include lists, stacks, and sets.

Formal definition of ADT

An abstract data type (ADT) is a mathematical model with a collection of operations defined on it. [Aho, 1983]

Stacks
Suppose your program needs to keep track of a stack of things. You have at least two choices for ways of implementing stacks:

* *

As an array As a linked list

Each method has it's advantages:

*Arrays are very efficient on storage, but are difficult to extend, easy to implement
*Linked lists have the overhead of a pointer for each item, are easy to extend, but are a bit harder to implement

Depending on the needs of your program, you will pick one of these methods.
Unfortunately, you may not be able to determine which is the best method to use until the middle or end of a project.

March 14, 1998

Page 7

C201/TAM