示例#1
0
        private static void ShowPermutations <T>(IEnumerable <T> input, int count)
        {
            var permuteService = new PermuteService();

            foreach (var permutation in permuteService.Permute(input, count))
            {
                foreach (var i in permutation)
                {
                    Console.Write(i);
                }
                Console.WriteLine();
            }
        }
示例#2
0
        public static List <List <string> > FindAllPermutes(string[] products, double supportCount, int level)
        {
            List <List <string> > temp = new List <List <string> >();

            foreach (var permutation in PermuteService.Permute(products.ToList(), level))
            {
                List <string> temp2 = new List <string>();
                foreach (string i in permutation.Distinct())
                {
                    temp2.Add(i);
                }
                temp.Add(temp2);
            }

            return(temp);
        }