Iterate over distinct combinations of a given size of this sequence's elements.
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public IEnumerable<ISequence<T>> Combinations(
int size
)
public IEnumerable<ISequence<T>> Combinations(
int size
)
Public Function Combinations (
size As Integer
) As IEnumerable(Of ISequence(Of T))
Public Function Combinations (
size As Integer
) As IEnumerable(Of ISequence(Of T))
public:
virtual IEnumerable<ISequence<T>^>^ Combinations(
int size
) sealed
public:
virtual IEnumerable<ISequence<T>^>^ Combinations(
int size
) sealed
abstract Combinations :
size : int -> IEnumerable<ISequence<'T>>
override Combinations :
size : int -> IEnumerable<ISequence<'T>>
abstract Combinations :
size : int -> IEnumerable<ISequence<'T>>
override Combinations :
size : int -> IEnumerable<ISequence<'T>>
Parameters
- size
- Type: System Int32
The size of each combination.
Return Value
Type:
IEnumerable ISequence T An iterator that traverses the possible n-element combinations of this sequence's elements.
Implements
ISequence T Combinations(Int32)Examples "abcd".AsSequence().Combinations(2) = ab, ac, ad, bc, bd, cd
See Also