MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / find_python_set

Function find_python_set

data_structures/disjoint_set/disjoint_set.py:51–60  ·  view source on GitHub ↗

Return a Python Standard Library set that contains i.

(node: Node)

Source from the content-addressed store, hash-verified

49
50
51def find_python_set(node: Node) -> set:
52 """
53 Return a Python Standard Library set that contains i.
54 """
55 sets = ({0, 1, 2}, {3, 4, 5})
56 for s in sets:
57 if node.data in s:
58 return s
59 msg = f"{node.data} is not in {sets}"
60 raise ValueError(msg)
61
62
63def test_disjoint_set() -> None:

Callers 1

test_disjoint_setFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_disjoint_setFunction · 0.68