@@ -9,7 +9,7 @@ set forest* (disjoint sets).
99Usage:
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
1313union! (a, 3 , 5 ) # merges the sets that contain 3 and 5 into one and returns the root of the new set
1414root_union! (a, x, y) # merges the sets that have root x and y into one and returns the root of the new set
1515find_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
2222One 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" ])
2626union! (a, " a" , " b" )
2727in_same_set (a, " c" , " d" )
2828push! (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.
0 commit comments