Guest User

Untitled

a guest
Apr 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. protected void permutation(int[] all, int[] current, int index)
  2.         {
  3.             if (index >= all.Length)
  4.             {
  5.                 MessageBox.Show("Permutation gefunden:" + current.ToString());
  6.             }
  7.             else
  8.             {
  9.                 for (int i = 0; i < all.Count(); i++)
  10.                 {
  11.             if (!current.Contains(all[i]))
  12.             {
  13.                         current[index] = all[i];
  14.                         permutation(all, current, index + 1);
  15.             }
  16.                 }
  17.             }
  18.         }
  19.  
  20.         protected void permutation(int[] all)
  21.         {
  22.             int[] current = new int[all.Length];
  23.             permutation(all, current, 0);
  24.         }
Add Comment
Please, Sign In to add comment