Python Data Structure linked list and python Data Structure
In a program, you often need to manage and enable a sequence group (usually of the same type) data elements as a whole. You need to create these element groups and the sequence variables record them, input and Output Functions. The number of elements contained in the limit group data may change accordingly (you can add or delete elements ).
For this requirement, the simplest solution is to regard the element of the sequence group as a sequence. The sequence element is in the position and sequence of the sequence, indicates a meaningful information in the actual response or a relationship between data.
The organizational form of such sequence elements can be abstracted as linear tables. A linear table is a sequence set of certain elements. It also records the sequence relationships between elements. A linear table is the basis of the most basic data structure. In actual programs, linear tables are often generic and often used as the basis for implementing more complex data structures.
There are two implementation models based on the actual storage of linear tables:
-
- An ordered table stores the elements in sequence in the continuous storage area of the primary block. The order between elements is expressed by their storage order.
- The linked list stores the elements in the series of shards constructed through links.
Why do you need a linked list:
To build a sequence table, you need to know how to apply for a continuous storage space in advance. When the sequence table is added to the sequence table, you need to migrate the sequence data. Therefore, the sequence table is not very flexible. The linked list structure can fully leverage the computer memory space for flexible dynamic memory management.
Definition of linked list:
A Linked list is the basic data structure of linear tables that are frequently used in sequence. It stores data in a continuous manner, but not in sequence, A region stores the location information (address) of each worker node (data storage unit ).