知识卡片
稳定排序保留同键顺序
稳定排序使相同键的元素保留原有先后次序。计数排序从输入末尾向前填充,并在每次填充后递减对应累计计数,让较早的同键元素落在较早位置。该性质在元素携带附属数据或作为基数排序的逐位子程序时至关重要。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第8章 线性时间排序 · 查看原书依据
elements with the same value appear in the output array in the same order as they do in the input array.
参考来源
- 位置:《算法导论(第4版)》第 8 章 8.2 节(`OEBPS/chapter008.xhtml`,文本字符 [9500, 12500);图 8.2/Art_P325)。
- 结论依据:原文直接定义稳定性,并说明计数排序逆向扫描和基数排序依赖此性质。
- 原始内容:elements with the same value appear in the output array in the same order as they do in the input array.