In computer
science, Abstract Data Types (ADT) is a programming methodology where one
defines not only the data structure to be used but the processes to manipulate the
structure.
Same as the
progress abstraction, ADT can be directly support by any programming languages.
To support the ADT, there needs to be mechanisms for defining data structures,
which is the basis and the primary in ADT. Second encapsulation of data
structures and their routines to manipulate the structures into one unit. It can
be compiled at one time by placing all definitions in one unit.
In programming
languages, there are some common types of ADTs such as Associative Array (we called it Dictionary in Python), method ‘append’,
list, queue and priority
queue, storage, method ‘pop’ and ‘push’ (in python), string and the tree we
have recently learned it. The data structure should only be accessible from
code encapsulated with it so that the structure is hidden and protected from
the outside. Users need only care for the interface but not how to realize. This
means that as long as the users follow the interface, the ADT can be implemented by any method and will never affect the users.
picture from http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html
No comments:
Post a Comment