知识卡片
路径压缩让查找路径直连根
路径压缩在 FIND-SET 找到根后,让本次查找路径上的节点直接指向根。
它缩短后续查找,但不改变集合成员或节点秩;未访问的其他路径不必在这次操作中改写。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第19章 不相交集合的数据结构 · 查看原书依据
The second heuristic, path compression, is also quite simple and highly effective. As shown in Figure 19.5, FIND-SET operations use it to make each node on the find path point directly to the root. Path compression does not change any ranks.
参考来源
- 位置:《算法导论(第4版)》第19章《不相交集合的数据结构》(OEBPS/chapter019.xhtml,文本字符[15000,20000))。
- 结论依据:原文描述FIND-SET沿途节点改为直指根且秩不变。
- 原始内容:The second heuristic, path compression , is also quite simple and highly effective. As shown in Figure 19.5 , F IND -S ET operations use it to make each node on the find path point directly to the root. Path compression does not change any ranks.