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

Method __init__

graphs/minimum_spanning_tree_kruskal2.py:18–20  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16class DisjointSetTree[T]:
17 # Disjoint Set DataStructure
18 def __init__(self) -> None:
19 # map from node name to the node object
20 self.map: dict[T, DisjointSetTreeNode[T]] = {}
21
22 def make_set(self, data: T) -> None:
23 # create a new set with x as its member

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected