void reverse_linklist(LinkNode *head)
{
//保存第二个结点的地址
LinkNode *p = head->next->next;
LinkNode *q = NULL;
//把第一个结点的指针域置为NULL
head->next->next = NULL;
while(p != NULL)
{
q = p->next; //保存下一个要头插结点的地址
p->next = head->next;
head->next = p;
p = q;
}
return;
}
标签:head,单链,结点,next,NULL,LinkNode,逆置 From: https://www.cnblogs.com/shinwind-123/p/17085524.html