Classic data structures Implementation and Analysis: singly linked list,

In this blog here again summed up what the current popular classic data structures; only here for a summary list, order form, simple and trees; please refer to the specific implementation: https://github.com/yaowenxu/codes/tree / master / data structure ; this article focuses on the nature of the data structure; and the nature of these data structures; knowledge is mainly used to organize and review;

 

Lists: list relative to the order table may take advantage of computer memory space; sequence table is a memory contiguous one position, it needs to know in advance the data size when building to apply a continuous memory space; and when to expand in the order table, it is necessary to order a copy of the migration table, and frees the old space, produce more memory copy; and the list can be when running out of space, you can directly declare and allocate memory node, into the end of the list; so you can easily implement flexible memory management ;

Advantages: save memory, dynamic memory management;

Disadvantages: only sequential access, not random access;

Single list:

Kept up to date, please indicate the source; for more information, please attention cnblogs.com/xuyaowen; 

Reference blog:

List

Order table

Guess you like

Origin www.cnblogs.com/xuyaowen/p/classic-data-structures.html