(int nodes)
| 18 | int parent[]; |
| 19 | int size[]; |
| 20 | DisjointSet(int nodes){ |
| 21 | this.parent = new int[nodes]; |
| 22 | this.size = new int[nodes]; |
| 23 | for(int i=0;i<nodes;i++){ |
| 24 | this.parent[i] = i; |
| 25 | this.size[i] = 1; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | public int findRootParent(int node){ |
| 30 | if(node == parent[node]){ |
nothing calls this directly
no outgoing calls
no test coverage detected