public class DisjointSets extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
DisjointSets.Subsets
Provides accessors for items in disjoint subsets.
|
| Constructor and Description |
|---|
DisjointSets(int size)
Creates a new structure containing a given number of items.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSameSubset(int i,
int j) |
void |
merge(int i,
int j) |
DisjointSets.Subsets |
subsets() |
public DisjointSets(int size)
size - the number of items contained in the setpublic boolean isSameSubset(int i,
int j)
public void merge(int i,
int j)
public DisjointSets.Subsets subsets()
Copyright © 2021. All rights reserved.