正在加载图片...
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
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有