[Postgraduate entrance examination or self-study data structure 1.1]-the basic concept of data structure, the three elements of data structure, data type, abstract data type

Offline notes download:
https://download.csdn.net/download/qq_38454176/12347554

1. Knowledge Framework

Insert picture description here

2. What is data

Data:
Data is a collection 信息的载体of numbers, characters and all 能输入到计算机中并被计算机程序识别和处理symbols that describe the attributes of objective things . Data is the raw material processed by computer programs.
Data is the result of facts or observations, a logical induction of objective things, and raw raw materials used to represent objective things.
Data can be continuous values, such as sound and images, which are called analog data. It can also be discrete, such as symbols and text, called digital data.
In a computer system, data is represented in the form of binary information units 0,1.

3. Basic concepts of data structure

3.1 Data elements, data items

数据元素It is the basic unit of data, which is usually considered and processed as a whole. A data element can be 数据项composed of several , and data items are inseparable of the data elements 最小单位.
Insert picture description here

3.2 Data structure, data object

Structure-The relationship between
数据结构each 关系element is a collection of one or more specific data elements between each other .
数据对象It is a 相同性质collection of data elements, which is a subset of data.

Example:
Data structure: information of queuing customers in a particular store and
the relationship between them.
Data object: information of queuing customers in all stores across the country
Insert picture description here

4. The three elements of data structure

Insert picture description here

4.1 Logical structure

4.1.1 Collection

Set: each element belongs to the same set, no other relationship
Insert picture description here

4.1.2 Linear structure

Linear structure: There is a one-to-one relationship between data elements. Except for the first element, all elements have a unique predecessor; except for the last element, all elements have a unique successor.
Insert picture description here

4.1.2 Tree structure

Tree structure: 一对多the relationship between data elements
Insert picture description here

4.1.4 Diagram structure

Graph structure: 多对多the relationship between data elements

Insert picture description here

4.2 The physical structure of the data (storage structure)

4.2.1 Sequential storage

Sequential storage: The logically adjacent elements are stored in storage units that are also adjacent in physical locations. The relationship between the elements is reflected by the adjacency relationship of the storage units

Insert picture description here

4.2.2 Chain storage

Chained storage: logically adjacent elements may not be adjacent in physical location, and the logical relationship between the elements is represented by a pointer indicating the storage address of the element.
Insert picture description here

4.2.3 Index storage

Index storage: While storing element information, an additional index table is also established. Each item in the index table is called an index item, and the general form of an index item is (keyword: address)

Insert picture description here

4.2.4 Hash storage

Hash storage. The storage address of the element is directly calculated according to the key of the element, also known as Hash storage. Details will be introduced later

4.2.5 Sequential storage summary

The introduction only needs to understand three points:

  1. If adopted 顺序存储, each data element must be physically 连续的; if adopted 非顺序存储, each data element can be physically 离散的.
  2. Data 存储结构meeting影响存储空间分配的方便程度
  3. Data 存储结构meeting影响对数据运算的速度

4.3 Calculation of data

Data operations-operations imposed on data include the definition and realization of operations.
运算的定义Yes 针对逻辑结构, point out the function of the operation; 运算的实现yes 针对存储结构, point out the specific operation steps of the operation.

Logical structure-linear structure (queue)
combined with the actual needs to define the operation of the logical structure of the queue:
①The head of the queue
element
goes out of the queue ; ②New element enters the queue; ③The length of the output queue
...

5. Data types, abstract data types

5.1.1 Data Type

A data type is a general term for a collection of values ​​and a set of operations defined on this collection.
1) Atomic type. A data type whose value cannot be subdivided.
Such as:

  • bool type: value range: true, false, operations available: and, or, non...
  • int type: value range: -2147483648 ~ 2147483647, operations can be performed: addition, subtraction, multiplication, division, modulo operation...

2) Structure type. Its value can be decomposed into data types of several components (components).
Such as:

struct Customer{
    
    
int num; //号数:定义一个具体的结构类型,表示排队顾客信息。根据具体业务需求来确定值的范围,可进行的操作
int people; //人数:值的范围:`num(1~9999)、people(1~12)`,可进行操作:如“拼桌”运算,把人数相加合并
…… //其他必要的信息
};

5.2 Abstract Data Type (Abstract Data Type, ADT)

Abstract Data Type (ADT) is an abstract data organization and related operations; ADT uses mathematical language to define the logical structure of data and define operations. Has nothing to do with the specific implementation

6. Highlights of this section

Insert picture description here

  • The data structure course focuses on the relationship between data elements, and the operations on these data elements, and does not care about the specific data item content

Offline notes download:
https://download.csdn.net/download/qq_38454176/12347554

Guess you like

Origin blog.csdn.net/qq_38454176/article/details/105654326