Linked list of Python data structures

Source: Internet
Author: User

In a program, it is often necessary to manage and make a group (usually the same type of) data element as a whole, to create this element group, to record them, to pass in the outgoing function, and so on.? The number of elements contained in the group data may vary (you can add or remove elements).

For this kind of demand, the simplest solution is to treat such a group element as a sequence,? The position and order of the elements in the sequence, representing some meaningful information in the actual should, or some kind of relationship between the data.

Like this? The organization of the group sequence element, which we can abstract as a linear table. A linear table is a collection of elements of a certain kind, and also records the order relationships between elements. Linear table is the most basic data structure, in the actual program should?? Frequently, it is often used as a basis for the implementation of more complex data structures.

According to the actual storage of the linear table, there are two kinds of implementation models:

      • Sequential table, in which elements are stored sequentially in the block contiguous storage?, the order relationships between elements are represented by their order of storage.
      • A linked list that stores elements in a series of storage blocks constructed from links.
Why a linked list is required:

The construction of sequential tables needs to know the data beforehand?? To apply for a continuous storage space, in the case of an expansion, it is necessary to move the data, so that it is not very flexible. The linked list structure can fully benefit the computer memory space for flexible memory dynamic management.

Definition of a linked list:

Linked list (Linked list) is the basic data structure, which is a kind of linear table, but it is not like sequential table, the data is stored continuously, is it in each node (data storage unit)? The location information (that is, the address) of the node is stored.

Linked list of Python data structures

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.