public static void Main(string[] args)
 {
     string ana = "resistance";
       var perm = new Permutation(ana);
       List<string> perms = perm.Resolve();
       foreach (string p in perms)
     Console.WriteLine(p);
       Console.WriteLine("Count: " + perms.Count);
 }
        public static void Main()
        {
            Permutation p = new Permutation();
            List<int[]> result = p.permutationUnique(new int[] { 1,1,1 });
            foreach (int[] a in result) {
                foreach (int i in a) {
                    Console.Write(i + " ");
                }
                Console.WriteLine();
            }

            Console.ReadLine();
        }
 private Permutation(string val, string rest)
 {
     this.val = val;
       if (rest.Length == 0)
       {
     return;
       }
       subs = new Permutation[rest.Length];
       for (int i = 0; i < rest.Length; i++)
       {
     subs[i] = new Permutation(rest[0].ToString(), rest.Substring(1));
     rest = rest.ShiftLeft();
       }
 }
Example #4
0
 public void smoke()
 {
     var p = new Permutation();
       var result = p.GetPermutations("ABC");
 }
Example #5
0
 public void smoke()
 {
     var p      = new Permutation();
     var result = p.GetPermutations("ABC");
 }