A comparison between sequential storage structure and chain-type storage structure
Advantages and disadvantages in order to store, adjacent data elements are also adjacent to the storage address (logical and physical unity); The address of the available storage units in memory must be contiguous.
Advantages: Large storage density (=1), high storage space utilization. Disadvantage: inconvenient when inserting or deleting elements. When chained storage, the adjacent data elements can be stored at will, but the storage space is divided into two parts, one part holds the value of the node, the other part holds the pointer of the relationship between the nodes.
Advantages: Easy to insert or delete elements, flexible to use. Disadvantage: Small storage density (<1), low storage space utilization. The
Usage Order table is suitable for the static operation such as lookup, and the linked list is fit for dynamic operation such as inserting and deleting. If the length of the linear table changes little, and its main operation is to find, then the sequential table, if the length of the linear table changes greatly, and its main operation is inserting, delete operation, then use the linked list.
Compare
Comparison of sequential table and linked list
Space-based comparison of how storage is allocated
The storage space of the sequential table is statically allocated the storage space of the linked list is dynamically allocated storage density = node data itself occupies the storage/node structure of the total memory
The storage density of the sequential table = 1 The storage density of the list < 1
Time-based comparison access mode
Sequential tables can be accessed randomly or sequentially access lists are sequential access inserts/deletes the number of elements moved
The sequential table needs to move nearly half of the element list without moving the elements, you just need to modify the pointer