当前位置:网站首页>Difference and the difference between array and array structure and linked list

Difference and the difference between array and array structure and linked list

2022-07-07 02:31:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm the king of the whole stack

1, The difference between an array and a linked list ? Call lists and arrays can be called linear forms . So called array Make an order , The main difference is , The order table is a continuous open space to store data in memory , Is the same type of data .

Linked lists are linked by pointers in existing elements , Each node contains two parts : One is storage data elements The data field of , Another is to store the address of the next node The pointer Domain , The linked list can not only connect multiple discontinuous spaces by pointers, but also use a continuous space , Logically form a continuous space to store data .

Both data structures have their own advantages . The linked list is convenient for deletion and insertion . Arrays are convenient for sorting . Arrays allocate space from the stack , For the program ape convenient high-speed , But the freedom is small .

The list allocates space from the heap , Great freedom, but application management is troublesome . 2, The difference between arrays and structures An array is a collection of elements of the same data type arranged in a certain order . It is a sequential table structure . stay C In language , Arrays are of construction data type . An array can be decomposed into multiple array elements , These array elements can be basic data types or construction types . Array can be divided into numerical array 、 A character array 、 Pointer array 、 Structure array and other categories A structure is a data collection consisting of a series of data of the same or different types .

The function of this structure is not easy . Its basic function is packaging

Copyright notice : This article is the original article of the blogger . Blog , Do not reprint without permission .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116859.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061846459578.html