Table of Contents

Method Partitions

Namespace
Gamelogic.Extensions.Algorithms
Assembly
Gamelogic.Extensions.dll

Partitions<T>(IEnumerable<T>)

Returns a list of all the partitions of a list.

public static IEnumerable<IEnumerable<IEnumerable<T>>> Partitions<T>(this IEnumerable<T> list)

Parameters

list IEnumerable<T>

The list.

Returns

IEnumerable<IEnumerable<IEnumerable<T>>>

IEnumerable<IEnumerable<IEnumerable<T>>>.

Type Parameters

T

Remarks

If the list is (a b c), then ((a) (b c)) and ((a) (b) (c)) would be examples of partitions.