Table of Contents

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

input IEnumerable<T>

The input sequence.

Returns

IEnumerable<IEnumerable<T>>

An enumerable of all 2^n subsets of the input.

Type Parameters

T

The type of elements in the input.

Exceptions

ArgumentNullException

input is null.