Data structure studies what data and the relationships between them do?
Data structure is the study of the physical structure, logical structure of data and the relationship between them.
Related introduction:
Data structure is the way computers store and organize data. A data structure refers to a collection of data elements that have one or more specific relationships with each other. Often, carefully selected data structures can lead to higher operating or storage efficiency. Data structures are often related to efficient retrieval algorithms and indexing techniques.
Research object
Logical structure of data
refers to the data structure that reflects the logical relationship between data elements, where The logical relationship refers to the relationship between data elements, regardless of their storage location in the computer. The logical structure includes:
1. Set: There is no other relationship between elements in the data structure except that they "belong to the same set";
2. Linear structure: Data structure There is a one-to-one relationship between the elements in the data structure;
3. Tree structure: There is a one-to-many relationship between the elements in the data structure;
4. Graphic structure: In the data structure There is a many-to-many relationship between the elements.
The physical structure of data
refers to the storage form of the logical structure of data in the computer storage space.
The physical structure of data is the representation of the data structure in the computer (also known as the image), which includes the in-machine representation of data elements and the in-machine representation of relationships. Since the specific implementation methods include sequence, linking, indexing, hashing, etc., a data structure can be expressed as one or more storage structures.
In-machine representation of data elements (mapping method): Data elements are represented by bit strings of binary bits (bits). This bit string is usually called a node. When a data element consists of several data items, the sub-bit string corresponding to each data item in the bit string is called the data field. Therefore, a node is an in-machine representation (or in-machine image) of a data element.
In-machine representation of relationships (mapping method): The in-machine representation of relationships between data elements can be divided into sequential images and non-sequential images. Two commonly used storage structures: sequential storage structures and chain storage structures . A sequential map represents the logical relationship between data elements by means of their relative positions in memory. Non-sequential images represent logical relationships between data elements with the help of pointers that indicate the storage locations of elements.
Data storage structure
The storage form of the logical structure of data in the computer storage space is called the physical structure of the data (also called the storage structure). Generally speaking, the logical structure of a data structure can be expressed as a variety of storage structures as needed. Commonly used storage structures include sequential storage, chain storage, index storage, hash storage, etc.
The characteristic of the sequential storage structure of data is that the logical relationship between data elements is represented by the relative position of the elements in the memory; the characteristic of non-sequential storage is that the data elements are represented by the pointer indicating the storage address of the element. logical relationship between them.
The above is the detailed content of Data structure is the study of data and the relationships between them. For more information, please follow other related articles on the PHP Chinese website!