1,实现双向链表按元素删除
//双向链表按元素删除
void DeleteByData(DoubleLink l,datatype e)
{
DoubleLink p = l;
int length = l->len;
for(int i=0;i<length;i++){
if(strcmp(e,p->next->data)==0){
DoubleLink q = p->next;
p->next = q->next;
q->next->prev = p;
free(q);
q=NULL;
l->len--;
}
else{
p = p->next;
}
}
}
2.实现循环双向链表按位置插入
//循环双向链表按位置插入
void InsertByPos(LoopDoubleLink l,int pos,datatype e)
{
if(l==NULL||pos<1||pos>l->len