Advertisement
stefanpu

Object mutation

Feb 9th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1.  
  2. class Permutations
  3. {
  4.     static void Main()
  5.     {
  6.         Console.WriteLine("Enter value for N: ");
  7.         int n = int.Parse(Console.ReadLine());
  8.  
  9.         Recursion rec = new Recursion();
  10.  
  11.         rec.InputSet = rec.MakeArray(n);
  12.         rec.CalcPermutation(0);
  13.  
  14.         rec.InputSet = rec.MakeArray(n + 1);
  15.         rec.CalcPermutation(0);
  16.        
  17.  
  18.         Console.WriteLine("# of Permutations: " + rec.PermutationCount);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement