[Home]Abstract data type

HomePage | Recent Changes | Preferences

Abstract data types are data structures described in terms of the operations they support (their interface) rather than how they are implemented.

For example, "linear list" is an abstract data type, defined as follows. A linear list contains a sequence of elements; it supports operations including the following:

Arrays, linked lists, and binary trees --- among other data structures --- can all support these operations, with different performance tradeoffs. Arrays are fast at accessing the Nth, previous, next, first, or last element, adding and deleting items at the end, but slow at inserting or deleting items from the middle or adding or deleting bunches of items; singly-linked lists are fast at accessing the first or next element, adding and deleting items or bunches of items anywhere, but slow at accessing the Nth, previous, or last element; and binary trees are fast at everything, although not nearly as fast as arrays or linked lists are at the things they're good for.

Some languages, such as Ada and Modula-2?, have explicit support for abstract data types. Object-oriented languages carry this a step further by adding inheritance and polymorphism to ADTs to get "objects".


HomePage | Recent Changes | Preferences
This page is read-only | View other revisions
Last edited October 26, 2001 2:35 am by 209.157.137.xxx (diff)
Search: