带头单链表逆置,下面程序有错吗?p=head->next;q=p->next;什么意思?void linklist_rev1(linklilst head); p=head->next;head->next=NULL;while(p){q=p->next;p->next=head->next;head->next=p;p=q;}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/04/28 10:29:44
带头单链表逆置,下面程序有错吗?p=head->next;q=p->next;什么意思?voidlinklist_rev1(linklilsthead);p=head->next;head->next

带头单链表逆置,下面程序有错吗?p=head->next;q=p->next;什么意思?void linklist_rev1(linklilst head); p=head->next;head->next=NULL;while(p){q=p->next;p->next=head->next;head->next=p;p=q;}
带头单链表逆置,下面程序有错吗?p=head->next;q=p->next;什么意思?
void linklist_rev1(linklilst head);
p=head->next;
head->next=NULL;
while(p)
{q=p->next;p->next=head->next;head->next=p;p=q;}

带头单链表逆置,下面程序有错吗?p=head->next;q=p->next;什么意思?void linklist_rev1(linklilst head); p=head->next;head->next=NULL;while(p){q=p->next;p->next=head->next;head->next=p;p=q;}
完全不对,你自己在图上画一画不就知道是什么意思了,看不懂这什么意思