//链表逆序
bool reverse_linklist(struct node *ph){
struct node *pbefore=NULL,*pafter,*pcur=NULL;
pbefore=ph;
pcur=ph->next;
if(pcur==NULL)
return false;
while(pcur!=NULL){
pafter=pcur->next;
//当前的下一个节点指向现在前面一个,
pcur->next=pbefore;
pbefore=pcur;
pcur=pafter;
}
ph->next->next=NULL;//将最后一个节点指向空
ph->next=pbefore;//将头结点指向逆序后的第一个节点
}
07-08
276
08-10
534