并查集 : 306页;静态图 有深度优先搜索算法 可以更快计算出个连通子图。 然而 对于动态 加入 需要维护连通子图。 并查集效率更高.
我对并查集的理解: 并查集实现起来很简单,但要灵活运用是需要经验积累的。。。其实说穿了,并查集中的集合就是相互间已经建立起某种联系的元素的集合,比如某个家族的所有成员就构成了一个集合;如果两个元素属于不同的集合,那么他们之间一定没有关系; 假如这两个元素产生了某种关系(这就好比两个人结婚了)那么这两个集合中的所有元素之间也必然相应的建立起了联系,接下来为了分析问题的必要,就必须把这两个集合合并起来union ,这方面网上资料很多,就不多说了。