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

Function find

graph/code15.cpp:30–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int find(vector<int> &parent, int x)
31{
32 if (parent[x] == x)
33 {
34 return x;
35 }
36 parent[x] = find(parent, parent[x]);
37 return parent[x];
38}
39
40void make_union(vector<int> &parent, vector<int> &rank, int a, int b)
41{

Callers 2

make_unionFunction · 0.70
kruskalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected