# Include <stdio. h> # include <string. h> # include <stdlib. h> # define list_init_size 100 # define add 10 typedef struct lnode {int date; struct lnode * Next;} lnode, * linklist; linklist creatlist_l () {linklist phead, P, L; L = (linklist) malloc (sizeof (lnode); int val, I, n; phead = (linklist) malloc (sizeof (lnode); phead = NULL; printf ("Enter the length of the linked list to be created: \ n"); scanf ("% d", & N); printf ("Enter the data you want to enter: \ n "); for (I = 0; I <n; ++ I) {s CANF ("% d", & Val); P = (linklist) malloc (sizeof (lnode); P-> date = val; If (phead = NULL) // search for the early node L = phead = P; else l-> next = P; L = P;} l-> next = NULL; return phead ;} // creatlist_llinklist resver_l (linklist head) {<span style = "white-space: pre"> </span> linklist P, Q, R; P = head; Q = r = NULL; while (p) {q = p-> next; P-> next = r; r = P; P = Q;} return r ;} // resver_lvoid output_l (linklist head) {linklist P; <span St YLE = "white-space: pre"> </span> P = (linklist) malloc (sizeof (lnode); <span style = "white-space: pre "> </span> P = head; <span style =" white-space: pre "> </span> while (P! = NULL) {<span style = "white-space: pre"> </span> printf ("% d", p-> date ); <span style = "white-space: pre"> </span> P = p-> next;} puts ("") ;}// output_lint main () {<span style = "white-space: pre"> </span> int N; <span style = "white-space: pre"> </span> linklist l, head; <span style = "white-space: pre"> </span> head = (linklist) malloc (sizeof (lnode); <span style = "white-space: pre "> </span> head = creatlist_l (); <span style =" white-space: pre "> </span> printf (" sequence before turning: \ n "); <span style =" white-space: pre "> </span> output_l (head); <span style =" white-space: pre "> </span> printf (" reverse sequence: \ n "); <span style =" white-space: pre "> </span> head = resver_l (head); <span style =" white-space: pre "> </span> output_l (head );}
Sequence flip pointer