正在加载图片...
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); }
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有