Data structure - linked list~

Both the sequential list and the linked list are part of the data structure and are the foundation of the data structure. They are very important. To learn the data structure well, you need to draw more pictures and write more code.

1. Linear table

A linear table is a finite sequence of n data elements with the same characteristics. Linear list is a data structure widely used in practice, common linear lists are: sequence list, linked list, stack, queue, string...

A linear table is logically a linear structure, that is, a continuous line. However, the physical structure is not necessarily continuous. When the linear table is stored in the physical structure, it is usually stored in the form of an array and a chain structure.

Second, the sequence table

The sequence table is a linear structure in which data elements are sequentially stored in a segment of storage units with consecutive physical addresses.

The sequence table can generally be divided into: static sequence table (using fixed-length array storage) and dynamic sequence table (using dynamically developed array storage).

Example:

Three, linked list

The linked list consists of nodes, the graph below represents a node, val represents the data field, and next represents the address of the next node.

The following figure is a one-way non-leading acyclic linked list, the address of the first node is stored in head, and the address of the next node is stored in head.next.

Guess you like

Origin blog.csdn.net/m0_62764440/article/details/121475519