Ejemplo n.º 1
0
        static void RunRecursionFibonacciNumbers()
        {
            var position    = Convert.ToInt32(Console.ReadLine());
            var backtracker = new Backtracker();

            Console.WriteLine(backtracker.CalculateFibonacciNumber(position));
        }
Ejemplo n.º 2
0
        static void RunRecursionDavisStaircase()
        {
            var stairsAmount = Convert.ToInt32(Console.ReadLine());
            var backtracker  = new Backtracker();

            for (var i = 0; i < stairsAmount; i++)
            {
                var stepsAmount = Convert.ToInt32(Console.ReadLine());

                int result = backtracker.CalculateWaysAmountToClimbTheLadder(stepsAmount);

                Console.WriteLine(result);
            }
        }