Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/algorithmzuo/algorithm-journey
/ find
Method
find
src/class154/FollowUp1.java:46–49 ·
view source on GitHub ↗
(int i)
Source
from the content-addressed store, hash-verified
44
}
45
46
public
static
int
find(
int
i) {
47
father[i] = father[i] == i ? i : find(father[i]);
48
return
father[i];
49
}
50
51
public
static
int
merge(
int
i,
int
j) {
52
if
(i == 0 || j == 0) {
Callers
1
remove
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected