Ejemplo n.º 1
0
 private static void RunFibonacci()
 {
     Console.WriteLine("Fibonacci - recursion");
     AlgorithmRunner.RunAlgorithm(Fibonacci.FibonacciNumber.ExecuteRecursion, 45);
     Console.WriteLine("Fibonacci - tail recursion");
     AlgorithmRunner.RunAlgorithm(Fibonacci.FibonacciNumber.ExecuteTailRecursion, 45);
     Console.WriteLine();
 }
Ejemplo n.º 2
0
 private static void RunAckerman()
 {
     Console.WriteLine("Ackerman");
     AlgorithmRunner.RunAlgorithm(Ackerman.AckermanFunction.Execute, 4, 0);
     AlgorithmRunner.RunAlgorithm(Ackerman.AckermanFunction.Execute, 3, 2);
     AlgorithmRunner.RunAlgorithm(Ackerman.AckermanFunction.Execute, 3, 4);
     //AlgorithmRunner.RunAlgorithm(Ackerman.AckermanFunction.Execute, 4, 1); //Stack overflow. - haha not expected
     Console.WriteLine();
 }
Ejemplo n.º 3
0
 private static void RunSort(Func <int[], int[]> algorithm, string name)
 {
     Console.WriteLine($"Run {name}");
     AlgorithmRunner.RunAlgorithm(algorithm, GetSortArray());
     Console.WriteLine();
 }