Differences between arrays and array structures and linked lists

Source: Internet
Author: User

1, the difference between an array and a linked list?
Call lists and arrays can be referred to as linear forms.
The so-called arrayThe main difference in making an order is that the order table is a contiguous open space to store the data in memory and is the same type of data.


The linked list is linked by pointers in the elements that exist, with each node having two parts: a data field that stores data elements, and a pointer field that stores the next node address , linked list It is possible to connect multiple discontinuous spaces by pointers and to use a continuous space.
Logically form a contiguous space to store the data.


Each of the two data structures has its advantages. Linked lists are easy to delete and insert. Arrays are easy to sort and so on.
The array allocates space from the stack, which is convenient and fast for the program ape, but with little freedom.


The linked list allocates space from the heap, and the degree of freedom is large but the application management is more troublesome.
2, the difference between array and struct body
An array is a collection of elements of the same data type arranged in a certain order. is a sequential table structure.
In the C language, an array is a constructed data type. An array can be decomposed into multiple array elements, which can be either basic data types or constructed types.
Arrays can also be divided into numerical arrays, character arrays, array of pointers, arrays of structures and other categories
A struct is a collection of data that consists of a series of data of the same type or different types.

The functional function of the structure is not easy. Its basic function is to package

Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.

Differences between arrays and array structures and linked lists

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.