带头单链表逆置,下面程序有错吗?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/05/03 22:02:49
带头单链表逆置,下面程序有错吗?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;}

带头单链表逆置,下面程序有错吗?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;}
完全不对,你自己在图上画一画不就知道是什么意思了,看不懂这什么意思