每天一个算法-Union Find
/ / 点击 / 阅读耗时 1 分钟并查集算法
简单实现了Quick-Union的并查集(增加了path compression)。还有Quick-Find, Weighted Quick-union, Weighted Quick-union With Path Compression. 参考https://blog.csdn.net/dm_vincent/article/details/7655764
1 | class UnionFind { |
并查集算法
简单实现了Quick-Union的并查集(增加了path compression)。还有Quick-Find, Weighted Quick-union, Weighted Quick-union With Path Compression. 参考https://blog.csdn.net/dm_vincent/article/details/7655764
1 | class UnionFind { |