Exemplo n.º 1
0
        private static void Main()
        {
            Console.Setup();
            Console.PrintHeading("Task 2 Generate All Combinations With Duplicates");

            int[] collection             = { 1, 2, 3, 4, 5 };
            int   combinationSetsLength  = 2;
            CombinatoricsGen <int> combo =
                new CombinatoricsesWithDuplicates <int>(combinationSetsLength, collection);

            var resultPrinter = new ResultPrinter(Console);

            resultPrinter.DispalyResults(collection, combinationSetsLength, combo);

            Console.PrintHeading("Task 3 Generate All Regular Combinations");

            combo = new CombinatoricsesRegular <int>(combinationSetsLength, collection);

            resultPrinter.DispalyResults(collection, combinationSetsLength, combo);
        }
Exemplo n.º 2
0
        private static void Main()
        {
            Console.Setup();

            Console.PrintHeading("Task 4 Permutations of numbers");

            ResultPrinter printer = new ResultPrinter(Console);

            int[] collection = { 1, 2, 3, 4 };

            int subsetSize = 4;

            CombinatoricsGen <int> combo = new PermutationsGenerator <int>(subsetSize, collection);

            printer.DispalyResults(collection, collection.Length, combo);
        }
        private static void Main()
        {
            Console.Setup();

            Console.PrintHeading("Task 5 Print Ordered Subsets of K from Set of N");

            string[] mainSet = { "hi", "a", "b" };

            int subsetLength = 2;

            var printer = new ResultPrinter(Console);

            CombinatoricsGen<string> combo = new PermutationsWithRepetition<string>(subsetLength, mainSet);

            printer.DispalyResults(mainSet, subsetLength, combo);
        }
        private static void Main()
        {
            Console.Setup();

            Console.PrintHeading("Task 4 Permutations of numbers");

            ResultPrinter printer = new ResultPrinter(Console);

            int[] collection = { 1, 2, 3, 4 };

            int subsetSize = 4;

            CombinatoricsGen<int> combo = new PermutationsGenerator<int>(subsetSize, collection);

            printer.DispalyResults(collection, collection.Length, combo);
        }
        private static void Main()
        {
            Console.Setup();

            Console.PrintHeading("Task 5 Print Ordered Subsets of K from Set of N");

            string[] mainSet = { "hi", "a", "b" };

            int subsetLength = 2;

            var printer = new ResultPrinter(Console);

            CombinatoricsGen <string> combo = new PermutationsWithRepetition <string>(subsetLength, mainSet);

            printer.DispalyResults(mainSet, subsetLength, combo);
        }
Exemplo n.º 6
0
        private static void Main()
        {
            Console.ConsoleMio.Setup();

            Console.ConsoleMio.PrintHeading("Task 6 All Subsets of K Strings");

            var printr = new ResultPrinter(Console.ConsoleMio);

            string[] collection = { "test", "rock", "fun" };

            int size = 2;

            CombinatoricsGen <string> combo = new CombinatoricsesRegular <string>(size, collection);

            printr.DispalyResults(collection, 2, combo);
        }