Differences between data structures, data types, and abstract data types

Source: Internet
Author: User

The terms data structure, data type, and abstract data type are literally different and similar, reflecting their differences and links in meaning.
Data structures are widely used terms in computer science and technology. It is used to reflect the internal structure of a data, that is, the components, methods, and structures of a data. Data structures are divided into logical and physical data structures. The logical data structure reflects the logical relationship between component data, and the physical data structure reflects the storage arrangement of component data in the computer. The data structure is the form of data.
Data is classified by data structure. data with the same data structure belongs to the same category. All data of the same type is called a data type. In advanced programming languages, a data type is used to indicate the attribution of a data in a data category. It is an attribute of data. This attribute limits the change range of the data. In order to solve the problem, a series of data types are defined based on the types of data structures. Different advanced languages define different data types. The types of data types defined by Pascal are 1-8.

 

 

 

Simple data types correspond to simple data structures. constructor data types correspond to complex data structures. In complex data structures, component data can have complex data structures, therefore, constructing data types allows composite nesting. the pointer type corresponds to the relationship between data points in the data structure. On the surface, it is a simple data type, in fact, they all point to the complex component data, that is, the data in the constructed data type. Therefore, it is not classified into a simple data type, nor is it classified into a constructed data type.
The data structure reflects the internal structure of the data. It is often described by a structure diagram: Each component in the data is regarded as a node and expressed in a box or circle, the relationship between component data is represented by a line with an arrow between the corresponding nodes. If the component data itself has its own structure, the structure is nested. Nesting can also be recursive nesting.
The introduction of pointer data makes it possible to construct various complex data structures. Based on the relationship between component data in the data structure, the data structure can be linear or non-linear. In the non-linear data structure, there are layers and networks. Because data types are divided by data structure, a type of data structure corresponds to a type of data. Data Types also have linear and non-linear structures and hierarchical and mesh structures based on the data presented in this type. The type description of a Data variable in advanced languages must be the data type corresponding to the data structure of the read variable.
The most common data structures are array structures and record structures. The array structure features:
The number of component data is fixed, and the logical relationship between them is reflected by the serial number of the component data (or the subscript of the array. These component data are arranged one by one according to the sequence number.
Each component data has the same structure (either a simple structure or a complex structure) and therefore belongs to the same data type (corresponding to a simple data type or a constructed data type ). The same data type is called the base type.
All component data is sequentially arranged in a continuous storage unit.
In summary, the array structure is a linear, uniform structure with random access to its component data. This structure has these good characteristics, so it is most often used by people. In advanced languages, the data type corresponding to the array structure is array type, that is, the data variable of the array structure must be described as array [I] of T0, where I is the subscript type of the array structure, while t0 is the base type of the array structure.
The record structure is another common data structure. It features:
Like the array structure, the number of component data is fixed. However, there is no natural order between component data and they are equal. Each component data is called a domain and assigned a domain name. Different domains have different domain names.
Different domains can have different structures, so they can belong to different data types.
Like the array structure, they can be accessed randomly, but the access path depends on the domain name.
In advanced languages, the data type corresponding to the record structure is record type. The data variable of the record structure must be described as the record type.
The meaning of abstract data types has been described in the previous section. It can be understood as a further abstraction of the data type. That is, computation on the Data Type and data type is bundled together for encapsulation. The purpose of introducing abstract data types is to separate the expression of data types and the implementation of data type operations from the reference of these data types and operations in the program so that they are independent of each other. The description of abstract data types must not only describe its data structure, but also describe the operations (procedures or functions) defined on it ). The process and function defined on the abstract data type are based on the data structure of the abstract data type.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.