What is the difference between the supplement of a linked list and the supplement of an array?

Source: Internet
Author: User

What is the difference between the supplement of a linked list and the supplement of an array?

Draft: 13:05:57

Differences between four linked lists and Arrays

Once the initial size of the array is determined, it cannot be changed. It is suitable for the case where the data volume to be processed is known.

Unknown amount of data to be processed using arrays may result in a waste of space or insufficient capacity. Although dynamic arrays can be resized, frequent resizing may cause a large overhead for the system.

The linked list capacity is not limited. The length is the same as the number of elements, but additional space is required to store the address of the next element. The space usage is not as good as the array.

Search by index. The time complexity of array access elements is O (1), and the linked list is O (n)

The time complexity for inserting and deleting linked lists is O (1), and the array is O (n)

The search value is an element of value, and the speed is the same.

Related Article

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.