Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 178 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 178 Bytes

xUnionFind

一个简单使用的并查集

uf = UnionFind()
uf.union(1, 2)
uf.union(3, 4)
uf.union(5, 6)
uf.union(1, 3)
uf.union(6, 4)

assert uf.connected(1, 6)