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;...

posted on Wednesday, September 26, 2007 8:22 PM | Print

Comments

No comments posted yet.
Post Comment
Title *  
Name *  
Email
Url
Comment *  
Please add 7 and 4 and type the answer here: