algorithms and ADTs (was Re: efficient idiomatic queue?)

Andrew Dalke dalke at dalkescientific.com
Tue Jan 15 23:36:11 EST 2002


Aahz Maruch wrote:
>Um, what's an ADT?

"abstract data type"

It's a data structure with associated methods (wasn't called
class nor object 20+ years ago) which can be used unchanged
in many different codes.

ADTS include lists, dicts, binary trees, priority queues, stack,
quad and oct trees.  Upon reflection, I seem to associate an
ADT with storage containers.

Here's the FOLDOC defintition from
  http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?ADT
> (ADT) A type whose internal form is hidden behind a set of access
> functions. Objects of the type are created and inspected only by
> calls to the access functions. This allows the implementation of
> the type to be changed without requiring any changes outside the
> module in which it is defined.

> Abstract data types are central to object-oriented programming
> where every class is an ADT.

But I wouldn't regard, say, the classes in rfy833.py as ADTs.

> A classic example of an ADT is a stack data type for which functions
> might be provided to create an empty stack, to push values onto a
> stack and to pop values from a stack.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list