知识卡片

普通读书笔记卡 · 3677.a

移至表首用当前访问调整链表

理解等级:中级

移至表首策略每次先查找目标,再通过相邻交换把它移到链表首位。

若原位置为r,本次成本是r次查找加r−1次交换,共2r−1;它用已发生的访问更新未来排列。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 第27章 在线算法 · 查看原书依据

      The online algorithm that we’ll explore is MOVE-TO-FRONT(L, x). This procedure first searches for x in the doubly linked list L, and then it moves x to the front of the list.1 If x is located at position r = rL(x) before the call, M

    参考来源

    - 位置:《算法导论(第4版)》第27章《在线算法》(OEBPS/chapter027.xhtml,文本字符[10000,15000))。 - 结论依据:原文定义在线决策或竞争比,并用电梯和搜索链表示例给出适用条件与成本。 - 原始内容:The online algorithm that we’ll explore is M OVE -T O -F RONT ( L , x ). This procedure first searches for x in the doubly linked list L , and then it moves x to the front of the list. 1 If x is located at position r = r L ( x ) before the call, M