(int n)
| 2 | int rank[]; |
| 3 | int parent[]; |
| 4 | DSU(int n){ |
| 5 | rank = new int[n]; //0 |
| 6 | parent = new int[n]; |
| 7 | for(int i=0;i<n;i++){ |
| 8 | parent[i] = i; |
| 9 | } |
| 10 | } |
| 11 | public int find(int node){ |
| 12 | if(node == parent[node]){ |
| 13 | return node; |
nothing calls this directly
no outgoing calls
no test coverage detected