static int CalFib(int n)
{
return n<=1?1:CalFib(n - 1) + CalFib(n - 2);
}
I hate when that happens...also remarkable just how inefficient this code becomes at higher values of n...
As a challenge, anyone care to give a way of making this code work efficiently on a multi-core (or processor, or both!) system? I'll give a possible answer at the weekend.
Hint, you might want to use System.Environment.ProcessorCount;...