Status Locate_D(DulLinkList &L,ElemType x)
{
ElemType p=L;//错误:DulLinkList p=L;
while(p->next!=L&&p->next->data!=x)
p=p->next;
if(p->next->data==x)
{ p->next->freq+=1; q=L;
while(p->next->freq
q=q->next;
/*q->next=p->next;
q->next-next->prior=p-next;
p->next=p->next->next;
p->next->prior=p;*/改为:
p->next->next=q->next;
p->next->prior=q->next->prior;
q->next->prior->next=p->nextt;
q->next->prior=p->next;
return p;//return 1;
}
else return NULL;
}//Locate_D