Current location - Loan Platform Complete Network - Big data management - Data Structures, LinkList *L with LinkList L and Lnode
Data Structures, LinkList *L with LinkList L and Lnode
LNode is the type of node you are defining, which is the variable in curly braces that contains the pointer field and the value field. *LinkList means that what you are defining is a linked list not a single node. LinkListL;L=malloc(sizeof(LinkList)); means to request space for the head node of a linked table and to make the pointer of the linked table point to that node. Because theoretically the space of a linked table can be infinite, i.e., the whole memory space can be used for it, so it is not necessary to specify the size of the space of the linked table in advance to continue to apply for the space of the next node. LinkListL; is to define a chain table. l=malloc(sizeof(LinkList)); is to apply for the head node for the chain table and make the pointer of the chain table point to the node LNode*p;p=malloc(sizeof(LNode)); is different from the previous sentence, this sentence is to mean that you apply for the space of a node. lNode *p; is defining a node first. p=malloc(sizeof(LNode)); means that you request memory space for that node. Just note the difference between a node and a linked table.