The allocation and collection of nodes in a linked list is implemented dynamically by the system-provided standard functions malloc and free, called dynamic linked lists.
If the program supports pointers, you can implement the linked list in our general form, allocate it when needed, and recycle it when it is not needed.
Dynamic linked list space can be dynamically expanded.
typedef struct node{
Eletype data;
struct node * PNEXT;
}node;
In some high-level languages, there is no "pointer" data type, only arrays can be used to simulate the structure of a linear list.
The pointer "field" in the array element holds not the actual address of the element in memory, but the position in the array. Such a linked list
Called a static linked list. And by defining a larger array of structures to act as an alternate node space (that is, the storage pool),
Each node should contain at least two domains: the data domain and the cursor domain.
Static single-linked list storage structure for linear tables:
#define MAXSIZE 100;
typedef struct
{
Elemtype data;
int cur;
}component,slinklist[maxsize];