Posted on 2006-06-22 23:32
Enjoy Life 阅读(402)
评论(0) 编辑 收藏 引用 所属分类:
程序员面试功略
//为了能够将函数处理的链表顺利的传出该函数,head必须用指针的指针
int DeleteElem(LNode **head, LNode *DElem){
LNode *elem;
elem=*head;
if(DElem == *head){
*head = elem->next;
free(DElem);
return 1;
}
while(elem){
if(elem->next == DElem){
elem->next = DElem->next;
free(DElem)
return 1;
}
elem = elm->next;
}
return 0;
}