Although the terms "data type" (or just "type"), "data structure" and "abstract data type" sound alike, they have different meanings.
In a programming language, the data type of a variable is the set of values that the variable may assume.
We can think of an abstract data type (ADT) as a mathematical model with a collection of operations defined on that model. Sets of integers, together with the operations of union, intersection, and set difference, form a simple example of an ADT.
As we have indicated, we shall design algorithms in terms of ADT's, but to implement an algorithm in a given programming language we must find some way of representing the ADT's in terms of the data types and operators supported by the programming language itself. To represent the mathematical model underlying an ADT we use data structures, which are collections of variables, possibly of several different data types, connected in various ways.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.