Advantages and disadvantages of sequential and chained storage structures 20

Updated on technology 2024-03-20
9 answers
  1. Anonymous users2024-02-07

    Storage space. The sequential storage structure requires the allocation of storage space in advance, that is, static allocation, so it is difficult to estimate the size of the storage space. If it is too large, it will cause waste, and if it is too small, it will easily cause space overflow.

    The storage space of the chained storage structure is dynamically allocated, and as long as the computer memory space is free, there will be no overflow.

    In addition, from the perspective of storage density, the definition formula of storage density is: generally speaking, the larger the storage density, the higher the utilization rate of storage space.

    Obviously, the sequential storage structure has a storage density of 1, while the chained storage structure has a storage density of less than 1.

    Computation time. A sequential table is a sequential storage structure, which can be directly accessed by any node in the table under the O(1) time complexity. When accessing a node in a linked list, you must start from the head pointer and follow the sequence of the linked list, and the time complexity is o(n).

    Linked list sequential lookup with time complexity of o(n).

    Therefore, if the operation on the linear table is mainly searching, it is better to use the sequential storage structure. If insertion and deletion are the main tasks, a chained storage structure is preferred.

  2. Anonymous users2024-02-06

    The sequential storage structure is to create a contiguous space in the memory to store data, so it must be a contiguous space for memory requirements and requirements. In data search (especially data that is not arranged in a regular manner), time complexity is reduced. High efficiency.

    The chain storage structure is to use a table pointer to indicate the storage location of the data, which can be stored in memory at will, and there is no requirement for continuous storage space, and the memory requirements are relatively easy to teach. However, if the data is arranged in order from small to large, the time complexity of the chain storage structure is small and the efficiency is high. However, irregularly arranged data generally has higher time complexity and lower efficiency.

  3. Anonymous users2024-02-05

    The differences are as follows:

    1. The memory address of the linked list storage structure is not necessarily continuous, but the memory address of the sequential storage structure must be continuous.

    2. Chained storage is suitable for inserting, deleting, and updating elements more frequently, while sequential storage structure is suitable for frequent queries.

    3. The sequence saves space compared with the chain type, because each node of the chain structure has a pointer storage domain. The sequence supports random access and is easy to operate. The chain type is more convenient and faster than the sequence.

    Of course, I have to say that this kind of official explanation is not very suitable for me, so if I use the way of a small turtle to talk about this concept, it is simply that a continuous address is used to store data elements, and the logical and physical relationships between the data are the same.

    Advantage 1: High storage density, high space utilization, space saving than chain storage.

    Advantage 2: The storage operation is convenient to operate, and the sequence supports random access, which will be easier to find.

  4. Anonymous users2024-02-04

    No.

    Sequential storage can be used to store not only linear structures, but also nonlinear structures, such as full binary trees.

    It is a nonlinear structure, but it is best stored sequentially.

    stacks, queues, and more. There are only two kinds of data storage structures: sequential storage structure and chain storage structure, these two good macro storage structures, the first one is to use data elements in memory.

    The relative position of the other indicates its logical structure, and the other is the pointer to represent its logical relationship.

    The sequential storage structure is not sockish.

    The main advantage is that it saves storage space, because the storage unit allocated to the data is all used to store the data of the nodes (regardless of the size of the array in the C C++ language), and the logical relationships between the nodes do not take up additional storage space.

    When this method is adopted, random access to nodes can be realized, that is, each node corresponds to a sequence number, and the storage address of the node can be directly calculated from the sequence number. However, the main disadvantage of the sequential storage method is that it is not easy to modify, and a series of nodes may have to be moved when inserting and deleting nodes.

  5. Anonymous users2024-02-03

    The storage structure is:

    (This set of storage units can be contiguous or discontinuous).

    Example: Chains. Examples: arrays, chains.

    Example: Clue tree.

    4. Hashing. Storage: Scattered pure knowledge column storage, also known as hash storage, is a search technology that tries to establish a correspondence between the storage location of data elements and key codes.

    Example: Stack (either sequential or random).

    In the sequential storage, each storage space contains the information of the stored elements themselves, and the logical relationship between the elements is the sequential storage of the linear table simply calculated by the array subscript position, if the subscript position of an element stored in the corresponding array is i, then its predecessor element in the corresponding array is the subscript position of i-1, and its successor element in the corresponding array is i+1.

    In a chained storage structure, the storage nodes contain not only the information about the elements themselves, but also the information about the logical relationships between the elements.

    In the sequential storage of data, since the storage location of each element can be calculated simply, the time to access the elements is the same.

    In the linked storage of data, since the storage location of each element is saved in its precursor or successor node, it can only be accessed by the pointer when its precursor node or successor node is accessed, and the time of accessing any element is related to the position of the element node in the chain storage structure.

  6. Anonymous users2024-02-02

    The advantages of sequential storage are:1. High space utilization. (Principle of locality, continuous storage, high hit rate) 2. Efficient access speed, direct storage through subscript.

    3. There is no need to add additional storage space to represent the logical relationship between nodes.

    4. It is convenient to randomly access any element in the table.

    Sequential storage disadvantages1. The insertion or deletion operation is inconvenient, except for the position of the table tail, a large number of nodes must be moved to insert or delete in other positions of the table, and its efficiency is low.

    2. Because sequential tables require continuous storage space, storage allocation can only be statically allocated in advance. Therefore, when the table length changes greatly, it is difficult to determine the appropriate storage scale.

    3. The length cannot be increased, there is a space limit, and when the number of elements that need to be accessed may be more than the number of elements in the sequential table, there will be an overflow problem. When the number of elements is much less than the pre-allocated space, there is a huge waste of space.

  7. Anonymous users2024-02-01

    (1) The storage location of the data element is used to represent the relationship between adjacent data elements in the linear table, that is, the logical structure of the linear table is consistent with the storage structure (physical structure), and the logical position is adjacent to each other, and the storage location is also adjacent.

    2) When accessing a sequentially stored linear table, you can use the formula (2 2) to quickly calculate the storage address of any data element. Therefore, it can be roughly assumed that the time spent accessing each data element is equal. This method of accessing elements is called the random access method, and the storage structure that uses this access method is called the random storage structure.

  8. Anonymous users2024-01-31

    Differences between sequential and chained storage structures: different storage methods, different storage efficiency, different storage space utilization, and different efficiency of insert and delete operations.

    1. The storage method is different.

    The sequential storage structure stores data elements in a contiguous storage space, while the chain storage structure stores data elements in a discontinuous vertical space of storage codes and connects them to each other by pointers.

    2. The storage efficiency is different.

    The sequential storage structure has faster access speed because the data elements are stored continuously in memory and can be accessed directly through subscripts; Chained storage structures, on the other hand, are slower to access because they need to be redirected by pointers.

    3. The utilization rate of storage space is different.

    Sequential storage structures have higher storage space utilization because no additional pointer space is required; Chained storage structures, on the other hand, have lower storage space utilization because they require additional pointer space.

    4. The efficiency of insertion and deletion operations is different.

    The insertion and deletion operations of sequential storage structures are inefficient because of the large number of data elements that need to be moved; Chained storage structures, on the other hand, are more efficient for inserting and deleting because only the pointer needs to be modified.

    Advantages of sequential storage structure and chain storage structure:

    Sequential Storage Structure:

    1. Random access (time complexity is o(1)).

    2. There is no need to add additional storage space to represent the logical relationships between elements in the table.

    Chained storage structure:

    Inserting and deleting the brother does not need to move data, and the efficiency is high (the time complexity is o(1)).

  9. Anonymous users2024-01-30

    The difference between the sequential storage structure and the chain storage structure.

    The memory address of the linked list storage structure is not necessarily sequential, but the memory address of the sequential storage structure must be continuous;

    Chained storage is useful when elements are inserted, deleted, and updated more frequently, while sequential storage structures are used when frequently queried.

    Advantages and disadvantages of sequential and chained storage structures:

    spatially. Sequencing is more space-saving than chaining. This is because of the chain structure, each node has a pointer storage domain.

    Storage operation:

    The sequence supports random access and is easy to operate.

    Insert and delete on:

    The chain is more convenient than the sequential (because the sequential table is also convenient for insertion, but the problem is that the insertion of the sequential table has a greater spatial complexity, and the element is moved back from the header index and the index, while the linked list is the index, and the insertion is completed).

    For example, when you query a letter j in a dictionary, you can choose two ways, first, sequential search, from the first page to the j. Second, index query, from the index of the dictionary, directly find out the number of pages of j, and directly find the number of pages, which may be the fastest than sequential query.

Related questions
15 answers2024-03-20

First of all, think about what data is stored in memory and what data is stored in files. >>>More

9 answers2024-03-20

It's not easy to find your parents...

Wouldn't it be nice to have a pointer to your father at each node... >>>More

7 answers2024-03-20

According to Gartner, by 2020, the global data volume will reach 35 zettabytes, equivalent to 8 billion 4TB hard drives. Data structure. >>>More

3 answers2024-03-20

The structure of the couplet is: 楹 (left and right structure) and coupling (left and right structure). >>>More

5 answers2024-03-20

BS is the abbreviation of Browser Server.

It is to use a browser (such as IE) as the application client to operate the server. This is easy to use in a browser, but it doesn't have good validation of the input. There are not many logical implementations. >>>More