Class DisJointSet<T>
A disjoint set implementation.
Inheritance
DisJointSet<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class DisJointSet<T> : IEnumerable<T>, IEnumerable
Type Parameters
Properties
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
Methods
|
Improve this Doc
View Source
FindSet(T)
Returns the reference member of the set where this member is part of.
Time complexity: log(n).
Declaration
public T FindSet(T member)
Parameters
Type |
Name |
Description |
T |
member |
|
Returns
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
|
Improve this Doc
View Source
MakeSet(T)
Creates a new set with given member.
Time complexity: log(n).
Declaration
public void MakeSet(T member)
Parameters
Type |
Name |
Description |
T |
member |
|
|
Improve this Doc
View Source
Union(T, T)
Union's given member's sets if given members are in differant sets.
Otherwise does nothing.
Time complexity: log(n).
Declaration
public void Union(T memberA, T memberB)
Parameters
Type |
Name |
Description |
T |
memberA |
|
T |
memberB |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements