文件名称:merge
介绍说明--下载内容均来自于网络,请自行研究使用
/*
*并查集:
*算法介绍:并查集是一种高效的支持合并查询的数据结构
* bcj[]保存前驱节点,是并查集的结构关系数组。
* rank[]保存集合元素个数,合并时按照元素个数多少合并。
*
*函数功能:Init()是初始化bcj[],rank[],初始时,把每个元素都当成一个集合
* Find(x)是查询元素x所在的集合.
* Merge(x, y)是合并x所在集合和y所在集合.
*/-/** And check the set:* algorithm introduced: a search set is an efficient data structure to support the combined query* bcj [] save precursor node is an array of structures and investigate the relationship between sets.* Rank [] to save the number of elements in the collection, consolidation in accordance with the number of elements in the number of merger.* Function: Init () to initialize bcj [], rank [], initially, each element is set as a* Find (x) where x is the set of query elements* Merge (x, y) is. where x and y merge collections where the collection.* /
*并查集:
*算法介绍:并查集是一种高效的支持合并查询的数据结构
* bcj[]保存前驱节点,是并查集的结构关系数组。
* rank[]保存集合元素个数,合并时按照元素个数多少合并。
*
*函数功能:Init()是初始化bcj[],rank[],初始时,把每个元素都当成一个集合
* Find(x)是查询元素x所在的集合.
* Merge(x, y)是合并x所在集合和y所在集合.
*/-/** And check the set:* algorithm introduced: a search set is an efficient data structure to support the combined query* bcj [] save precursor node is an array of structures and investigate the relationship between sets.* Rank [] to save the number of elements in the collection, consolidation in accordance with the number of elements in the number of merger.* Function: Init () to initialize bcj [], rank [], initially, each element is set as a* Find (x) where x is the set of query elements* Merge (x, y) is. where x and y merge collections where the collection.* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
merge.cpp