MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / find

Method find

Python/Kruskal's_Algorithm.py:14–17  ·  view source on GitHub ↗
(self, parent, i)

Source from the content-addressed store, hash-verified

12 # Search function
13
14 def find(self, parent, i):
15 if parent[i] == i:
16 return i
17 return self.find(parent, parent[i])
18
19 def apply_union(self, parent, rank, x, y):
20 xroot = self.find(parent, x)

Callers 2

apply_unionMethod · 0.95
kruskal_algoMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected