计算机问题求解一论题3-4 -用于动态等价关系的数据结构 2022年09月28日
计算机问题求解 – 论题3-4 -用于动态等价关系的数据结构 2022年09月28日
问题1: 什么是等价关系? 它有什么应用意义?
创建“迷宫” 入口 i' 问题2: ' 你能否基于动态 等价关系的概念 出口 来解释这个生成 过程?
创建“迷宫” 入口 出口 i j 问题2: 你能否基于动态 等价关系的概念 来解释这个生成 过程? i' j
问题3: 我们用什么数据结构实现 动态等价关系? 这个数据结构的基本操作 是什么?
问题3: 我们用什么数据结构实现 动态等价关系? 这个数据结构的基本操作 是什么?
ADT of disjoint-set MAKE-SET(x)creates a new set whose only member (and thus representative) is x.Since the sets are disjoint,we require that x not already be in some other set. UNION(x.y)unites the dynamic sets that contain x and y,say Sx and Sy,into a new set that is the union of these two sets.We assume that the two sets are dis- joint prior to the operation.The representative of the resulting set is any member of SxU Sy,although many implementations of UNION specifically choose the representative of either Sx or Sy as the new representative.Since we require the sets in the collection to be disjoint,conceptually we destroy sets Sx and Sy, removing them from the collection 8.In practice,we often absorb the elements of one of the sets into the other set. FIND-SET(x)returns a pointer to the representative of the (unique)set contain- ingx
ADT of disjoint-set