dlinklist locate(dilnklist L, datatype x) p=L->next while(p&&p->data!=x p=p->next if(p) return(NULL) p->freq++ while(p->prior!=L&&p->prior->freqp->freq) k=p-→ prior->data; p->prior->data=p->data p->data=k k=p->prior->freq p->prior->freqp->freq p->freq=k; p=p->prior; return(p)dlinklist locate(dilnklist L,datatype x) { p=L->next; while (p&&p->data!=x) p=p->next; if (!p) return(NULL); p->freq++; while (p->prior!=L&&p->prior->freq<p->freq) { k=p->prior->data; p->prior->data=p->data; p->data=k; k=p->prior->freq; p->prior->freq=p->freq; p->freq=k; p=p->prior; } return(p); }