计算机问题求解一论题3-5 -用于动态等价关系的数据结构 2018年10月09日
计算机问题求解 – 论题3-5 -用于动态等价关系的数据结构 2018年10月09日
问题1: 什么是等价关系? 它有什么应用意义?
创建“迷宫” 入口 间题2 你能否基于动态 等价关系的概念 出口 来解释这个生成 过程?
创建“迷宫” 入口 出口 i j
间题3: 我们用什么数据结构实现 动态等价关系? 这个数据结构的基本操作 是什么?
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 S,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 SxUSy,although many implementations of UNION specifically choose the representative of either Sx or S 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- ing x