Data structure is a widely used term in the whole computer science and technology field. It is used to reflect the internal composition of a data, that is, a data is composed of those constituent data, in what way and in what structure.
Data structures can be divided into logical data structures and physical data structures. The logical data structure reflects the logical relationship between component data, while the physical data structure reflects the storage arrangement of component data in the computer. Data structure is the existing form of data.
Data structure is a way to organize information, and its purpose is to improve the efficiency of the algorithm. It usually corresponds to a set of algorithms, through which some operations can be performed on the data in the data structure. Data structure mainly studies various logical structures and storage structures of data, as well as various operations on data.
So there are three main aspects: the logical structure of data; Physical storage structure of data; An operation (or algorithm) on data. Usually, the design of algorithm depends on the logical structure of data, and the implementation of algorithm depends on the physical storage structure of data.
Extended data:
1. Logical structure of data: refers to the data structure that reflects the logical relationship between data elements, where the logical relationship refers to the antecedent relationship between data elements, regardless of their storage locations in the computer.
The logical structure includes:
1. collection: there is no other relationship between elements in the data structure except that they belong to the same collection.
2. Linear structure: there is a one-to-one correspondence between elements in the data structure;
3. Tree structure: the elements in the data structure have a one-to-many relationship;
4. Graphic structure: There is a many-to-many relationship between elements in the data structure.
Physical structure of data: refers to the storage form of logical structure of data in computer storage space.
The physical structure of data is the representation of data structure in computer (also called image), including the built-in representation of data elements and the built-in representation of relationships.
Because there are many ways to achieve it, such as sorting, linking, indexing, hashing and so on. A data structure can be represented as one or more storage structures.
Built-in representation of data elements (mapping method): data elements are represented by bit strings of binary 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 a data field. Therefore, nodes are built-in representations (or built-in images) of data elements.
Built-in representation of relationships (mapping method): The built-in representation of relationships between data elements can be divided into sequential images and non-sequential images, and there are two commonly used storage structures: sequential storage structure and chain storage structure.
Sequential images represent the logical relationship between data elements through their relative positions in the memory. Non-sequential images represent the logical relationship between data elements through pointers indicating the storage locations of elements.
Third, structural algorithm.
The design of the algorithm depends on the data (logical) structure, and the implementation of the algorithm depends on the storage structure adopted. The storage structure of data is essentially the realization of its logical structure in computer memory. In order to fully reflect the logical structure of a data, its image in memory includes two aspects, namely, the information between data elements and the relationship between data elements.
Different data structures have corresponding operations. Data operation is an operation algorithm defined on the logical structure of data, such as retrieval, insertion, deletion, update, sorting, etc.
Baidu Encyclopedia-Data Structure