for(p = head; p->next = NULL; p = p->next);p->next =
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/04/29 01:15:37
for(p = head; p->next = NULL; p = p->next);p->next =
int insert(int id)
{
node_t *p,*q;
/* creat new node */
q = new_node(id);
if(q == NULL) return -1;
/* nothing in the link */
if(head == NULL){
head = q; return 0;
}
/* get the last one */
for(p = head; p->next = NULL; p = p->next);
/* get into the link */
p->next = q;
return 0;
}
最后那两句不太明白呀.q是最后一个结点么
int insert(int id)
{
node_t *p,*q;
/* creat new node */
q = new_node(id);
if(q == NULL) return -1;
/* nothing in the link */
if(head == NULL){
head = q; return 0;
}
/* get the last one */
for(p = head; p->next = NULL; p = p->next);
/* get into the link */
p->next = q;
return 0;
}
最后那两句不太明白呀.q是最后一个结点么
应该是一个链表指针p的遍历,直到结尾p==NULL
for(p = head; p->next = NULL; p = p->next);p->next =
while(p->next)p=p->next;
单链表逆位序输值L->next=NuLL,p->next=L->next,L->next=p什么意思
if(p!=NULL)p->next=NULL;for(i=4;i
head->next!=p与head=p的区别
=NULL与p->next!=NULL区别?
这段C代码i == head->next=NULL:head->next = p; 提示错误lvalue require
q=p->next;p->next=NULL单独看知道什么意思,
答案是p->next=head 还是p->next!=head
p->next=q->next;啥意思,
s->next=p->next;的含义
p->next=L->next是什么意思