知识卡片

普通读书笔记卡 · 3634.a.3

并集操作替换两旧集合

理解等级:中级

UNION(x,y) 把分别包含 x、y 的两个集合合为一个;原有两个集合从集合族中消失,合并后代表元可取并集中任一成员,常见实现选原两集合中的一个代表元。

它不是把元素复制到第三个仍共存的集合。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 第19章 不相交集合的数据结构 · 查看原书依据

      UNION(x, y) unites two disjoint, dynamic sets that contain x and y, say Sx and Sy, into a new set that is the union of these two sets. The representative of the resulting set is any member of Sx ∪ Sy, although many implementations of UNION specifically choose the representative of either Sx or Sy as the new representative. Since the sets in the collection must at all times be disjoint, the UNION operation destroys sets Sx and Sy, removing them from the collection S.

    参考来源

    - 位置:《算法导论(第4版)》第19章《不相交集合的数据结构》(OEBPS/chapter019.xhtml,文本字符[0,5000))。 - 结论依据:原文定义并集结果、代表元选择和旧集合被移除的语义。 - 原始内容:U NION ( x , y ) unites two disjoint, dynamic sets that contain x and y , say S x and S y , into a new set that is the union of these two sets. The representative of the resulting set is any member of S x ∪ S y , although many implementations of U NION specifically choose the representative of either S x or S y as the new representative. Since the sets in the collection must at all times be disjoint, the U NION operation destroys sets S x and S y , removing them from the collection S .