Interface IDisjointSet<T>
A disjoint-set data structure.
Namespace: QuikGraph.Collections
Assembly: QuikGraph.dll
Syntax
public interface IDisjointSet<T>
Type Parameters
Name | Description |
---|---|
T | Element type. |
Properties
| Improve this Doc View SourceElementCount
Gets the current number of elements.
Declaration
int ElementCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SetCount
Gets the current number of sets.
Declaration
int SetCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceAreInSameSet(T, T)
Gets a value indicating if left and right are contained in the same set.
Declaration
bool AreInSameSet(T left, T right)
Parameters
Type | Name | Description |
---|---|---|
T | left | Left value. |
T | right | Right value. |
Returns
Type | Description |
---|---|
System.Boolean | True if both values are in the same set, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Contains(T)
Gets a value indicating whether the value is in the data structure.
Declaration
bool Contains(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean | True if the value is already in the set, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
FindSet(T)
Finds the set containing the value
.
Declaration
T FindSet(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to search. |
Returns
Type | Description |
---|---|
T | Root value of the set. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
MakeSet(T)
Creates a new set for the value
.
Declaration
void MakeSet(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Union(T, T)
Merges the sets from the two values.
Declaration
bool Union(T left, T right)
Parameters
Type | Name | Description |
---|---|---|
T | left | Left value. |
T | right | Right value. |
Returns
Type | Description |
---|---|
System.Boolean | True if |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|