UtilCombinatoricsCalculatePermutationsT(IEnumerableT, Int32, Boolean) Method
Calculates the amount of permutations that can be generated with the specified collection
and string length.
Namespace: DevCase.Core.Math.CombinatoricsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static long CalculatePermutations<T>(
IEnumerable<T> collection,
int stringLength,
bool allowRepetition
)
Public Shared Function CalculatePermutations(Of T) (
collection As IEnumerable(Of T),
stringLength As Integer,
allowRepetition As Boolean
) As Long
Dim collection As IEnumerable(Of T)
Dim stringLength As Integer
Dim allowRepetition As Boolean
Dim returnValue As Long
returnValue = UtilCombinatorics.CalculatePermutations(collection,
stringLength, allowRepetition)
public:
generic<typename T>
static long long CalculatePermutations(
IEnumerable<T>^ collection,
int stringLength,
bool allowRepetition
)
static member CalculatePermutations :
collection : IEnumerable<'T> *
stringLength : int *
allowRepetition : bool -> int64
No code example is currently available or this language may not be supported.
- collection IEnumerableT
-
An IEnumerableT that contains the elements to permute.
- stringLength Int32
-
The desired string length of each permutation.
- allowRepetition Boolean
-
A value indicating whether permutation repetition is allowed.
- T
Int64
The resulting amount of permutations that can be generated.
This is a code example.
No code example is currently available or this language may not be supported.
Dim collection As Char() = "1234".ToCharArray()
Dim stringLength As Integer = 2
Dim result As Long = CalculatePermutations(collection, stringLength, allowRepetition:=True)
Console.WriteLine(result)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.