Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xingyue MA
xepTemplateLibrary
Commits
1c886a97
Commit
1c886a97
authored
May 27, 2021
by
CDK6182CHR
Browse files
2021.5.27 update UFSet::find()
parent
caed942d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ufset.cpp
View file @
1c886a97
...
...
@@ -62,9 +62,9 @@ int UFSet::find(int x) const
int
UFSet
::
find
(
int
x
)
{
int
root
=
static_cast
<
const
UFSet
*>
(
this
)
->
find
(
x
);
while
(
data
[
x
]
>=
0
)
{
x
=
data
[
x
];
while
(
x
!=
root
)
{
data
[
x
]
=
root
;
x
=
data
[
x
];
}
return
root
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment