big-o-notation/Exponential/Program.cs
2024-10-04 14:20:48 +01:00

21 lines
345 B
C#

using System;
namespace Exponential
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine(fib(6));
}
static int fib(int num)
{
if (num <= 1) return num;
return fib(num - 2) + fib(num - 1);
}
}
}