[Dahua Data Structure-Introduction to Data Structure ①]

1. Opening remarks

The purpose of learning data structures is neither for money, nor for degrees and exams, but to better feel the beauty of programming!

2. How did you learn data structures?

It shows that data structure is an essential skill for programmers, and the subject of data structure is inseparable from both study and work. After learning data structure and algorithms such as search and sorting, it is necessary to understand its principles and implementation methods, and based on this Other complex algorithms can be implemented on top of it, which has the effect of inferring others.

3. The origin of data structure

Data structure is a discipline that studies the operation objects in programming problems of non-numerical computing, as well as the relationship and operation between
them . The algorithm of this data model is then implemented by writing a program to let the computer solve practical problems in life.

Programming = Data Structures + Algorithms

4. Basic Concepts and Terminology

  1. Data : It is a symbol that describes objective things, an object that can be manipulated in a computer, and a collection of symbols that can be recognized by the computer and input to the computer for processing. ( with numeric data and non-numeric data )
  2. Data element : It is the basic unit that makes up the data and has a certain meaning. It is usually processed as a whole in the computer, also called the record. ( equivalent to people in humans, populations in organisms represent classes of the same attribute )
  3. Data items : A data element can consist of several data items. A data item is the smallest unit of indivisible data .
  4. Data Object : A collection of data elements of the same nature, a subset of data.
  5. Data structure : A collection of data elements that have one or more specific relationships with each other. (Data elements are not isolated, data collections with internal connections)

5. Logical structure and physical structure

1. Logical structure

Refers to the relationship between data elements in a data object

  1. Set structure : The data elements in the set structure have no other relationship except that they belong to the same set . (similar to sets in mathematics)
    insert image description here

  2. Linear structure : There is a one-to -one relationship between data elements in a linear structure .

insert image description here
3. Tree structure : There is a one-to-many hierarchical relationship between the data elements of the tree structure .
insert image description here

  1. Graph structure : The data elements of the graph structure are in a many-to-many relationship.

insert image description here

The logical structure is for specific problems, in order to solve a certain problem, on the basis of understanding the problem, select a suitable data structure to represent the logical relationship between data elements

2. Physical structure

It refers to the storage form of the logical structure of data in the computer and
how to store the logical relationship between data elements. It is the key and difficulty of realizing the physical structure!

  1. Sequential storage structure : It stores data elements in storage units with consecutive addresses, and the logical and physical relationships between the data are consistent. (memory distribution of the array)insert image description here
  2. Chained storage structure : It stores data elements in any storage unit. This group of storage units can be continuous or discontinuous. (Similar to the escape room we have played, each level is connected in series through clues, each level only knows the location of the next level, and cannot directly know the location of the third level, it can only lead to the second level to find the third level location, the storage location is more flexible)insert image description here

6. Abstract data types

1. Data type

It is a general term for a set of values ​​with the same properties and some operations defined on this set.

  • Atomic type: It is a basic type that cannot be decomposed again, including integer, real, character, etc.
  • Structural type: It is composed of several types and can be decomposed. For example, an integer array is composed of several integer data.
    Abstraction refers to extracting the universal essence of things

2. Abstract data types

Refers to a mathematical model and a set of operations defined on that model.
Abstract data types embody the characteristics of problem decomposition, abstraction and information hiding in programming.

7. Summary review

A data structure is a collection of data elements that have one or more specific relationships to each other.
insert image description here

Guess you like

Origin blog.csdn.net/a6662580/article/details/122739996
Recommended