Skip to content

Commit 35d87fe

Browse files
authored
Merge pull request #959 from m-fila/disjointset_rename_docs
Fix naming of DisjointSet in documentation and tests
2 parents c86628e + 8f3241b commit 35d87fe

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/src/disjoint_sets.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set forest* (disjoint sets).
99
Usage:
1010

1111
```julia
12-
a = IntDisjointSets(10) # creates a forest comprised of 10 singletons
12+
a = IntDisjointSet(10) # creates a forest comprised of 10 singletons
1313
union!(a, 3, 5) # merges the sets that contain 3 and 5 into one and returns the root of the new set
1414
root_union!(a, x, y) # merges the sets that have root x and y into one and returns the root of the new set
1515
find_root!(a, 3) # finds the root element of the subset that contains 3
@@ -22,14 +22,14 @@ num_groups(a) # returns the number of sets
2222
One may also use other element types:
2323

2424
```julia
25-
a = DisjointSets{AbstractString}(["a", "b", "c", "d"])
25+
a = DisjointSet{AbstractString}(["a", "b", "c", "d"])
2626
union!(a, "a", "b")
2727
in_same_set(a, "c", "d")
2828
push!(a, "f")
2929
```
3030

31-
Note that the internal implementation of `IntDisjointSets` is based on
32-
vectors, and is very efficient. `DisjointSets{T}` is a wrapper of
33-
`IntDisjointSets`, which uses a dictionary to map input elements to an
34-
internal index. Note for `DisjointSets`, `union!`, `root_union!` and
31+
Note that the internal implementation of `IntDisjointSet` is based on
32+
vectors, and is very efficient. `DisjointSet{T}` is a wrapper of
33+
`IntDisjointSet`, which uses a dictionary to map input elements to an
34+
internal index. Note for `DisjointSet`, `union!`, `root_union!` and
3535
`find_root!` return the index of the root.

test/bench_disjoint_set.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ const n = 2 * (10^6)
88
const T0 = 10
99
const T = 10^6
1010

11-
function batch_union!(s::IntDisjointSets, x::Vector{Int}, y::Vector{Int})
11+
function batch_union!(s::IntDisjointSet, x::Vector{Int}, y::Vector{Int})
1212
for i = 1 : length(x)
1313
@inbounds union!(s, x[i], y[i])
1414
end
1515
end
1616

17-
s = IntDisjointSets(n)
17+
s = IntDisjointSet(n)
1818

1919
# warming
2020

0 commit comments

Comments
 (0)