Enumerates the indexes of all permutations
from a set of items.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static IEnumerable<T[]> Permutations<T>(
IList<T> items,
bool lexicographic
)
Public Shared Function Permutations(Of T) (
items As IList(Of T),
lexicographic As Boolean
) As IEnumerable(Of T())
public:
generic<typename T>
static IEnumerable<array<T>^>^ Permutations(
IList<T>^ items,
bool lexicographic
)
static member Permutations :
items : IList<'T> *
lexicographic : bool -> IEnumerable<'T[]>
Parameters
- items
- Type: System.Collections.GenericIListT
A list of items. - lexicographic
- Type: SystemBoolean
Specifies whether the permutations
should be returned in lexicographic order.
Type Parameters
- T
Return Value
Type:
IEnumerableTA sequence of arrays that contain
all permutations of the elements of
items.
If
lexicographic is
,
then the permutations are returned in lexicographic order.
When lexicographic order is not required, it is faster to set
lexicographic to .
Reference