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