Postgraduate entrance examination or self-study data structure 1.1
Offline notes download:
https://download.csdn.net/download/qq_38454176/12347554
1. Knowledge Framework
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 最小单位
.
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
4. The three elements of data structure
4.1 Logical structure
4.1.1 Collection
Set: each element belongs to the same set, no other relationship
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.
4.1.2 Tree structure
Tree structure: 一对多
the relationship between data elements
4.1.4 Diagram structure
Graph structure: 多对多
the relationship between data elements
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
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.
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)
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:
- If adopted
顺序存储
, each data element must be physically连续的
; if adopted非顺序存储
, each data element can be physically离散的
. - Data
存储结构
meeting影响存储空间分配的方便程度
- 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
- 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