public void Teste3AlgoritmoGuloso() { //output 3 var happyPmp = new HappyPmp("1 5 2 3 4", "1 2 3 4 5"); var teste = happyPmp.ObterMimPermutation(); Assert.Equals(3, teste); }
public void Teste4AlgoritmoGuloso() { //output 3 var happyPmp = new HappyPmp("2 1 10 3 7 8 5 6 9 4", "6 9 2 4 1 10 3 7 8 5"); var teste = happyPmp.ObterMimPermutation(); Assert.Equals(3, teste); }
public void Teste1AlgoritmoGuloso() { //output 2 var happyPmp = new HappyPmp("3 2 1", "1 2 3"); var teste = happyPmp.ObterMimPermutation(); Assert.Equals(2, teste); }
private static void ImprimirHappyPmp(HappyPmp happyPmp) { Console.Write("Entrada: "); foreach (var permutation in HappyPmp.Permutations) { Console.Write(permutation.Valor + " "); } Console.Write("\nSaida: "); var nPermutation = happyPmp.ObterMimPermutation(); foreach (var permutation in HappyPmp.Permutations) { Console.Write(permutation.Valor + " "); } Console.WriteLine("\nPermutations: " + nPermutation); Console.WriteLine(" "); }