Skip to content

Instantly share code, notes, and snippets.

View eriawan's full-sized avatar
:octocat:
Focusing on .NET, C#, F# and Azure DevOps

Eriawan Kusumawardhono eriawan

:octocat:
Focusing on .NET, C#, F# and Azure DevOps
View GitHub Profile
@eriawan
eriawan / Program.cs
Last active May 22, 2023 19:46
A helper class to enable trampoline to handle large recursive by adapting Y Combinator
internal class Program
{
static void Main(string[] args)
{
var fac10 = Factorial(10);
Console.WriteLine("Factorial 10 = " + fac10);
var fac20 = Factorial(20);
Console.WriteLine("Factorial 20 " + fac20);
var facAddition8000 = Factorial(8000);
// code below will throw StackOverflowException