知识卡片
相邻交换使逆序数改变一
相邻元素交换只改变这一对元素的相对次序,因此相对于固定的另一排列,逆序数恰好增加或减少1。该局部变化使总重排成本可转化为势能变化。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第27章 在线算法 · 查看原书依据
Therefore, if two consecutive elements x and y swap positions in a list L, then for any other list L′, the value of the inversion count I(L, L′) either increases by 1 or decreases by 1. As we compare MOVE-TO-F
参考来源
- 位置:《算法导论(第4版)》第27章《在线算法》(OEBPS/chapter027.xhtml,文本字符[15000,20000))。
- 结论依据:原文分别定义逆序、势能比较或缓存策略及其成本模型;正文补充其用途与边界。
- 原始内容:Therefore, if two consecutive elements x and y swap positions in a list L , then for any other list L ′, the value of the inversion count I ( L , L ′) either increases by 1 or decreases by 1. As we compare M OVE -T O -F