赞
踩
- Node * ListDeleteMore(Node *head,int x)
- {
- Node *p=head;
- Node *pf=NULL;
- Node *s=NULL;
- while(p!=NULL)
- {
- if(head->val==x)
- {
- p=p->next;
- head=p;
- }
- else if(p->val==x)
- {
- s=p;
- p=p->next;
- pf->next=s->next;
- free(s);
- }
- else
- {
- pf=p;
- p=p->next;
- }
- }
- return head;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。