文件名称:Locate
介绍说明--下载内容均来自于网络,请自行研究使用
设有一头指针为L的带有表头结点的非循环双向链表,其每个结点中除有prev(前驱指针),data(数据)和next(后继指针)域外,还有一个访问频度域freq。在链表被起用前,其值均初始化为零。每当在链表中进行一次Locate(L,x)运算时,令元素值为x的结点中freq域的值增1,并使此链表中结点保持按访问频度非增(递减)的顺序排列,同时最近访问的结点排在频度相同的结点的最后,以便使频繁访问的结点总是靠近表头。试编写符合上述要求的Locate(L,x)运算的算法,该运算为函数过程,返回找到结点的地址,类型为指针型。-Has a pointer to L, non-circular doubly linked list with a header node, each node in addition to prev (precursor pointer), data (data) and next (the successor pointer) extraterritorial, as well as a visit to the frequency degree domain freq. Before the list is hired, their values are initialized to zero. Whenever the time the Locate (L, x) operator in the list, so that the elements of value of the freq domain value in the node x is increased by 1, and frequency-access node in the linked list to keep non-increasing (decreasing) the order, while the most recently accessed nodes ranked in the frequency of the same node last, so that the frequently accessed node is always close to the header. Ciphering algorithms test preparation the Locate (L, x) meets the above requirements, the operator as a function of the process, and return to find the address of the node type is a pointer type.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Locate.cpp