Logical structure

According to different viewpoints, the data structure is divided into physical structure and logical structure.
Logical structure:
refers to the mutual relationship between data elements in the data object. The logical structure is divided into the following four types:
1. Collection structure
The data elements in the collection structure have no other relationship except they belong to the same collection. Each data element is "equal", and their common attribute is "belong to the same set". The collection relationship in the data structure is similar to the collection in mathematics.
The picture is a collection structure
2. Linear structure
There is a one-to-one relationship between data elements in a linear structure. It can be understood as a serial data stream.
Insert picture description here
3. Tree structure
There is a one-to-many hierarchical relationship between the data elements in the tree structure. It can be understood that there are multiple commanders under the commander of the army, and multiple commanders under one commander (all have played it).
Insert picture description here
4. Graphic structure
The data elements of the graphic structure are many-to-many. When
Insert picture description here
we use schematic diagrams to represent the logical structure of data, we should pay attention to two points:
1. Think of each data element as a node, represented by a circle.
2. The logical relationship between elements is represented by the connection between nodes. If the relationship is directional, then the connection with arrows is used to indicate the order and flow of data.
It can also be seen from the above that the logical structure is *** for specific problems ***, in order to *** solve a problem ***, on the basis of understanding the problem, select a suitable data structure to represent the data The logical relationship between elements.

Published 53 original articles · praised 16 · visits 2213

Guess you like

Origin blog.csdn.net/m0_37757533/article/details/100188860