Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
disjoint sets
woonie
Oct 3rd, 2012
139
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Java
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
Union
-
find Disjoint Sets
public
UnionFind
(
int
N
)
{
parent
=
new
int
[
N
]
;
rank
=
new
int
[
N
]
;
//all 0
numSets
=
N
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
parent
[
i
]
=
i
;
}
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
JSON | 1 hour ago | 1.15 KB
2026_06_updated_lune
10 hours ago | 1.82 KB
other setups
13 hours ago | 0.15 KB
Untitled
13 hours ago | 0.16 KB
DROP20
19 hours ago | 1.44 KB
API 'ping' test
Python | 1 day ago | 0.53 KB
Slide notes
1 day ago | 2.46 KB
AMP floater example implementation
1 day ago | 2.32 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!