| PermutationPermuteT Method |
Apply a
Permutation sequence to rearrange the supplied list or array.
Namespace:
Kaos.Combinatorics
Assembly:
KaosCombinatorics (in KaosCombinatorics.dll) Version: 6.0.0.0
Syntax Exceptions Examples using System;
using System.Collections.Generic;
using Kaos.Combinatorics;
namespace ExampleApp
{
public class Furniture
{
public string Name { get; private set; }
public Furniture (string name) { Name = name; }
public override string ToString() => Name;
}
public class Fruit
{
public string Name { get; private set; }
public Fruit (string name) { Name = name; }
public override string ToString() => Name;
}
class PnExample03
{
static void Main()
{
var things = new List<object>
{
new Fruit ("apple"),
new Furniture ("bench"),
new Furniture ("chair")
};
foreach (var row in new Permutation (things.Count).GetRows())
Console.WriteLine (String.Join (" ", Permutation.Permute (row, things)));
}
}
}
See Also