【Data structure】Basic concept of data structure


mind Mapping

insert image description here


Basic concepts and terminology of data structures

  • data: the data iscarrier of information. It is a collection of numbers, characters, and all symbols that can be input into a computer and recognized and processed by a computer program to describe the attributes of objective things.
  • Data element: is the basic unit of data. A data element can consist of multiple data items. A data item is the indivisible smallest unit that constitutes a data element.
  • Data object: A collection of data elements with the same nature, which is a subset of data.
  • Data type: A collection of values ​​and a set of operations defined on this collection. There are atomic types, structural types, and abstract data types.
  • Data Structure: Structure is the relationship of data elements to each other. A data structure is a collection of data elements that have one or more specific relationships with each other. It is divided into logical structure, storage structure, and data operation.

Three elements of data structure

logical structure

Logical structure refers to the logical relationship between data, and describes the data from the logical relationship, which has nothing to do with the storage of data.
insert image description here

storage structure

The storage structure of data refers to the representation of the data structure in the computer, also known as the physical structure, including the representation of the relationship and the representation of the data elements. Divided into sequential storage, chain storage, index storage, hash storage (hash storage).

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

insert image description here

Operation of data

Operations applied to data include definition and implementation of operations. The definition of operation is aimed at the logical structure, pointing out the function of the operation; the realization of the operation is aimed at the storage structure, pointing out the specific operation steps of the operation.
insert image description here

important knowledge

  1. A complete data structure can be defined with an abstract data type.
  2. When storing data, it is usually necessary to store not only the value of each data element, but also the relationship between data elements.
  3. The logical structure of data is independent of its storage structure.
  4. When designing chained storage, the addresses of the storage units in the nodes must be continuous.
  5. For two different data structures, their logical structure and physical structure may be the same. For example, a binary tree and a binary sorting tree. The binary sorting tree can adopt the logical representation and storage method of the binary tree. The former is usually used to represent hierarchical relationships, and the latter is usually used for sorting and searching. Although their operations all have the functions of building trees, inserting nodes, deleting nodes, and finding nodes, the definitions of these operations are different for binary trees and binary sorted trees.
  6. A linear table can be implemented in either sequential or chained storage. In the sequential storage mode, inserting and deleting elements in the linear table requires moving nearly half of the elements on average, and the time complexity is O(n); while in the linked storage mode, the time complexity of inserting and deleting is O (1).

Summarize

The above is today's learning content~
If you are interested, you can subscribe to the column and continue to update~
See you next time~
insert image description here

Supongo que te gusta

Origin blog.csdn.net/m0_55394328/article/details/131680721
Recomendado
Clasificación