Python Data Structure linked list and python Data Structure

Source: Internet
Author: User

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 ).

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.