Method PowerSet
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
PowerSet<T>(IEnumerable<T>)
Returns the power set of the input, that is, all possible subsets of the input.
public static IEnumerable<IEnumerable<T>> PowerSet<T>(this IEnumerable<T> input)
Parameters
inputIEnumerable<T>The input sequence.
Returns
- IEnumerable<IEnumerable<T>>
An enumerable of all 2^n subsets of the input.
Type Parameters
TThe type of elements in the input.
Exceptions
- ArgumentNullException
inputis null.