Home > Common Problem > What are abstract data types

What are abstract data types

coldplay.xixi
Release: 2020-06-29 09:43:34
Original
19205 people have browsed it

Abstract data type refers to a mathematical model and a set of operations defined on the model. It only depends on its logical characteristics and has nothing to do with how the computer is represented and implemented internally. It embodies the decomposition of problems in programming. and information hiding characteristics.

What are abstract data types

Abstract data type (ADT) refers toa mathematical model and a set of data defined on the model operate. It only depends on its logical characteristics and has nothing to do with how it is represented and implemented inside the computer. For example, the integer type just mentioned. Every computer, whether mainframe, minicomputer, PC, tablet or even smartphone, has an "integer" type, which also requires integer operations. So the integer type is actually an abstract data type. .

According to the definition of an abstract data type, it also includes a set of

operations on that model. Just like the classic Nintendo game "Super Mario", the protagonist of the game is Mario. We have defined basic operations for him, such as forward, backward, jumping, shooting bullets, etc. This is an abstract data type that defines a data object, the relationship between elements in the object, and operations on the data elements.

As for what operations they are, this can only be determined by the designer based on actual needs. For example, Mario may only be able to walk and jump at first, but later he found that he should add an operation to shoot bullets, and then he added the operation of pressing and holding the bullet button and moving forward to run. This is all determined based on the actual situation.

What are abstract data types

#In fact, abstract data types embody the characteristics of problem decomposition and information hiding in programming. It decomposes the problem into multiple smaller and easier-to-handle problems, and then implements each functional module as an independent unit, and realizes the entire problem through one or more calls.

Supplement:

Representation and format of abstract data types:

ADT = (D,S,P) (D:数据对象 S:D上的关系集 P:D上的一组操作)
Copy after login
ADT 抽象数据类型名称{
      数据对象:<数据对象的定义>;
      数据关系:<数据关系的定义>;
      基本操作:<基本操作的定义>
}
Copy after login

Related learning recommendations:

PHP programming from entry to proficiency

The above is the detailed content of What are abstract data types. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template