Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 556 Bytes

File metadata and controls

9 lines (6 loc) · 556 Bytes

union-find

Implementation of union find algorithm and its application in C++

介绍

这是union-find算法的C++实现,其中以带路径压缩的加权quick-union的实现为主,union,find操作时间复杂度接近O(1).  

之后使用union-find算法结合Monto Carlo采样估计渗透系统(percolation system)模型的阈值。了解更多关于percolation system请看这里

Union-find算法可作为实现小游戏“鳄鱼宝宝爱洗澡”的关键算法。