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

Function findPar

CPP/graph_tree/Kruskal-Algo.cpp:18–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18int findPar(int u, vector<int> &parent) {
19 if(u == parent[u]) return u;
20 return parent[u] = findPar(parent[u], parent);
21}
22
23void unionn(int u, int v, vector<int> &parent, vector<int> &rank) {
24 u = findPar(u, parent);

Callers 2

unionnFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected