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

Method find

java/Graphs/ConnectTheDots.java:38–44  ·  view source on GitHub ↗
(int x)

Source from the content-addressed store, hash-verified

36 }
37
38 public int find(int x) {
39 if (x == this.parent[x]) {
40 return x;
41 }
42 this.parent[x] = find(this.parent[x]);
43 return this.parent[x];
44 }
45}
46
47public class ConnectTheDots {

Callers 1

unionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected