Every line of 'python disjoint set' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
6 def testUnionFind(self): 7 ds = DisjointSet(range(100)) 8 for i in range(100): 9 ds.union(i, i % 5) 10 for i in range(100): 11 for j in range(i, 100): 12 self.assertEqual(ds.find_set(i) == ds.find_set(j), i%5 ==j%5)