Home  >  Article  >  A singly linked list is not a random storage structure, right?

A singly linked list is not a random storage structure, right?

王林
王林Original
2020-06-24 11:25:4315723browse

A singly linked list is not a random storage structure, right?

Singly linked list is not a random storage structure, yes.

Introduction to relevant knowledge points:

What is a singly linked list?

Singly linked list is a chained access data structure that uses a set of storage units with arbitrary addresses to store data elements in the linear list.

The data in the linked list is represented by nodes. Each node is composed of: element (image of data element) pointer (indicating the storage location of subsequent elements). The element is the storage unit where data is stored. The pointer is the address data connecting each node.

Linked storage method

The linear list stored in the linked method is referred to as a linked list (Linked List).

The specific storage representation of the linked list is:

1. Use a set of arbitrary storage units to store the nodes of the linear table (this set of storage units can be continuous , it can also be discontinuous)

2. The logical order and physical order of the nodes in the linked list are not necessarily the same. In order to correctly represent the logical relationship between nodes, while storing the value of each node, the address (or location) information indicating its subsequent nodes must also be stored (called a pointer or link)

Linked storage is one of the most commonly used storage methods. It can be used not only to represent linear tables, but also to represent various non-linear data structures.

The above is the detailed content of A singly linked list is not a random storage structure, right?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn