链表倒置的函数:
NODE *invert(NODE *h) //头指针发生变化,故将新的头指针返回重置
{
NODE *a, *b, *c;
a = h;
b = h->next;
c = b->next;
a->next = NULL;
do
{
b->next = a;
a = b;
b = c;
c = c->next;
}while(c!=NULL);
b->next = a;
a = b;
return (a);
}
NODE *invert(NODE *h) //头指针发生变化,故将新的头指针返回重置
{
NODE *a, *b, *c;
a = h;
b = h->next;
c = b->next;
a->next = NULL;
do
{
b->next = a;
a = b;
b = c;
c = c->next;
}while(c!=NULL);
b->next = a;
a = b;
return (a);
}