[Data structure·Standard C language implementation] Linked lists: linear, circular, and doubly linked lists

In many of the previous textbooks, the implementation of data structures is based on C++. For many students who have not studied C++, they have caused certain obstacles in the process of learning data structures. For this reason, I hope to learn from the standard C language. From the perspective, to comprehensively describe the various algorithms of the data structure.

Linked list

As the content of the first chapter, the linked list is a topic that cannot be bypassed in the data structure, so we start to learn from the linked list.
The linked list includes several parts, there are linear lists, circular linked lists, and doubly linked lists. Let’s look at an example of a linear list below.Instantiation of linked list

Linear table

The realization of the linear table is relatively simple, as long as you have a deep understanding of the definition and application of the structure, you can easily implement it. The definition and application of the structure are mentioned here. It is an indispensable part of the C language learning. This part is for beginners. It may be difficult to say, but it must be mastered.

For the implementation process of the linear table, please see https://www.bilibili.com/read/cv7451817. The
graphics and the code of each step are relatively clear. In order to simplify the implementation process, simple examples are listed when implementing each algorithm. If there are some places that are not rigorous, please understand.

Circular linked list

On the basis of understanding the linear list, it is relatively easy to understand the circular linked list. As long as the ending two nodes are connected to form a circular chain shape, the entire linked list can be traversed circularly.
For the same please refer to this column https://www.bilibili.com/read/cv7463989.

Doubly linked list

It is also based on the understanding of the structure, adding a pointer to the previous node on the basis of the linear list, so that the nodes are connected smoothly, and the entire linked list can be traversed from front to back, or the linked list can be traversed from back to front.
The same , please refer to this column https://www.bilibili.com/read/cv7478475.

Guess you like

Origin blog.csdn.net/m0_50984266/article/details/108759212