Exemplo n.º 1
0
 static public int[] ParsePermutation(string permutation)
 {
     int[] returnedPermutation = { 1, 2 };
     if (permutation[0] == '<')
     {
         returnedPermutation = ParseVector(permutation);
     }
     else if (permutation[0] == '(')
     {
         int[][] cyclePermutation = ParseCycle(permutation);
         returnedPermutation = WithoutRepetition.CycleToPermutation(cyclePermutation);
     }
     else
     {
         throw new Exception("Bad format of permutation.");
     }
     return(returnedPermutation);
 }