There was no big change, so this part of the book was just a two-paragraph skip.
#include <stdio.h>#include<stdlib.h>typedefintElemtype;structnode{Node*Next; Elemtype data;};voidCreateList (node*&L) {L= (node*)malloc(sizeof(Node)); if(! L) Exit (-2); L->next =L; L->data =0;}voidInsertlist (node*&L,elemtype e) {Node*p =L; for(intI=0; i<l->data;++i) {p=p->Next; } Node*s =NULL; S= (node*)malloc(sizeof(Node)); S->data =e; S->next = p->Next; P->next =s; + + (l->data);}voidDeleteList (Node*&l,intN) {Node*p =L; if(n<1|| N>l->data) Exit (-2); for(inti =0; i<n-1; i++) {p=p->Next; } Node*temp = p->Next; P->next = p->next->Next; Free(temp); --l->data;}voidShowlist (node*&m) {Node*p =L; while(p->next!=m) {printf (">%d\t", (P)data); P=p->Next; } printf ("\ n");}intMain () {Node*N1; CreateList (N1); Insertlist (N1,1); Showlist (N1); Insertlist (N1,2); Showlist (N1); Insertlist (N1,3); Showlist (N1); Insertlist (N1,4); Showlist (N1); Insertlist (N1,5); Showlist (N1); DeleteList (N1,1); Showlist (N1); DeleteList (N1,2); Showlist (N1);}
2. Change the basic list to a circular link list