MCPcopy Create free account
hub / github.com/ByteByteGoHq/coding-interview-patterns / findSet

Method findSet

cpp/Graphs/connect_the_dots.cpp:36–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 }
35
36 int findSet(int x) {
37 if (x == parent[x]) {
38 return x;
39 }
40 parent[x] = findSet(parent[x]);
41 return parent[x];
42 }
43};
44
45int connectTheDots(std::vector<std::vector<int>>& points) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected