Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add num_groups for DisjointSets to documentation #843

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/src/disjoint_sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ Usage:
a = IntDisjointSets(10) # creates a forest comprised of 10 singletons
union!(a, 3, 5) # merges the sets that contain 3 and 5 into one and returns the root of the new set
root_union!(a, x, y) # merges the sets that have root x and y into one and returns the root of the new set
find_root!(a, 3) # finds the root element of the subset that contains 3
find_root!(a, 3) # finds the root element of the subset that contains 3
in_same_set(a, x, y) # determines whether x and y are in the same set
elem = push!(a) # adds a single element in a new set; returns the new element
# (this operation is often called MakeSet)
num_groups(a) # returns the number of sets
```

One may also use other element types:
Expand Down