I. Basic concepts of linked lists
Single linked list: The structure of N nodes linked into a chain linear table is called a linked list, and when each node contains only one pointer field, it is called a single-linked list
Header node: The first node in a linked list, containing pointers to the first data element and some information about the list itself, such as length, etc.
?? Data node: A node in a linked list that represents a data element, containing a reference to the next data element
?? Tail node: The last data node in a linked list, the next element pointer is empty, indicating no successor .
Two. Definition of linked list
Due to the convenience of the leading list operation, all the operations described below are based on a single linked list of the header nodes.
1. Definition of linked list
1 /* */2struct list3{4 int data; // data fields 5 struct // pointer Field 6 }linklist;
View Code
Basic operations for a one-way list-Create, insert, delete