Four types of data storage structures
There are four types of data storage structures: sequential storage, linked storage, index storage, and hash storage. Sequential and linked structures apply to memory structures. Index and hash structures are suitable for interaction between external memory and memory.
Sequential storage: In computer, a group of contiguous storage units are used to store the data elements of a linear table in sequence, called the sequential storage structure of a linear table. Features: Random access table elements; Insertion and deletion operations require moving elements.
Linked storage: In computer, data elements of a linear table are stored in an arbitrary set of storage units (which may be contiguous or discontinuous). It does not require logically adjacent elements to be physically adjacent. Therefore, it does not have the weakness of sequential storage structure, but it also loses the advantage of random access of sequential table.
Features:
- Lower storage density compared to sequential storage structure (each node is composed of data field and pointer field, so using sequential storage structure can store more data than using linked storage structure in the same storage space.
- Logically adjacent nodes do not have to be physically adjacent.
- Flexible insertion and deletion (no need to move the node, only need to change the pointer in the node).
- Linked storage is slower than sequential storage when finding nodes.
- Each node is composed of data field and pointer field.
Index storage: In addition to establish storage node information, also establish additional index table to identify the node address. An index table consists of several index entries. The index storage structure uses the index number of the node to identify the node storage address, which has the advantage of fast retrieval, but the disadvantage is that additional index tables occupy more storage space.
Hash storage: Hash storage is a lookup technology that tries to establish a definitive relationship between the storage location of data elements and keys. The basic idea of hash storage is that the storage address of the node is determined by the key of the node.
Comments
Post a Comment