youtube-code/2022-12-09-Big-O-Notation/Exponential/Program.cs

22 lines
345 B
C#
Raw Normal View History

2022-12-08 12:13:53 +00:00
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);
}
}
}