Advantages and disadvantages of sequential tables and linked list storage

Source: Internet
Author: User

advantages and disadvantages of sequential tables and linked list storage

1. Sequential table Storage

Principle: Sequential table storage is to put data elements into a contiguous memory storage space, access efficiency, fast. But you can't increase the length dynamically.

Advantages: Efficient access, direct storage via subscript

Cons: 1. Insertions and deletions are slow, 2. Length cannot be increased

For example: when inserting or deleting an element, the entire table needs to traverse the moving elements to rearrange the order


2. Linked List Storage

Principle: The chain table storage is the dynamic allocation space in the process of running the program, as long as the memory has space, there will be no storage overflow problem

Pros: Fast insertion and deletion, preserving the original physical order, such as inserting or deleting an element, just change the pointer to point

Cons: Lookup is slow because you need to have a circular link list access when looking


From their storage advantages and disadvantages, each has its own usage scenarios, such as: frequent lookups but very few insert and delete operations can be stored in the sequential table, if the frequent inserts and deletions of small queries can use the linked list storage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.