上海龙凤1314 shlf写出程序把一个链表中的接点顺序倒排
typedef struct linknode
{
int data;
上海龙凤1314 shlf struct linknode *next;
}node;
//将一个链表逆置
上海龙凤1314 shlf node *reverse(node *head)
{
node *p,*q,*r;
p=head;
上海龙凤1314 shlf q=p->next;
while(q!=NULL)
{
上海龙凤1314 shlf r=q->next;
q->next=p;
p=q;
q=r;
}
head->next=NULL;
head=p;
return head;
}
【写出程序把一个链表中的接点顺序倒排】相关文章:
5.链表题
6.笔试题(链表)