Home >Common Problem >What are the two commonly used storage structures for linear tables? What are the characteristics of each?
The storage of linear tables usually uses two storage structures: sequential storage structure and chain storage structure. The characteristics of the sequential storage structure: high storage density, high storage space utilization, and random access according to element serial numbers. The characteristics of the chain storage structure: low storage density and low storage space utilization; no random access, only sequential access; insertion and deletion operations are convenient and flexible.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
The two storage structures of linear tables are sequential storage structure and chain storage structure.
The main features of the sequential storage structure:
(1) The node only has its own information field and no associated information field. Therefore, the sequential storage structure has high storage density and high storage space utilization.
(2) Any data element can be accessed directly by calculating the address, that is, it can be accessed randomly.
(3) Insertion and deletion operations will cause the movement of a large number of elements.
The main features of the chain storage structure:
(1) In addition to its own information field, the node also has a pointer field representing associated information. Therefore, the chain storage structure has low storage density and low storage space utilization.
(2) Logically adjacent nodes do not have to be physically adjacent. Therefore, random access is not possible, only sequential access.
(3) Insertion and deletion operations are convenient and flexible. You don’t have to move the node, you just need to modify the pointer field in the node.
For more programming-related knowledge, please visit: Programming Teaching! !
The above is the detailed content of What are the two commonly used storage structures for linear tables? What are the characteristics of each?. For more information, please follow other related articles on the PHP Chinese website!