1 typedef struct Link 2 { 3 int data; 4 struct Link* next; 5 }NODE,*pNODE;
1 void reverse(pNODE *pphead) 2 { 3 pNODE pcur = *pphead, ppre = NULL, ptemp; 4 while(pcur != NULL) 5 { 6 ptemp = pcur->next; 7 pcur->next = ppre; 8 ppre = pcur; 9 pcur = ptemp; 10 } 11 *pphead = ppre; 12 }