mostlylucid

scott galloway's personal blog...
posts - 897, comments - 700, trackbacks - 11

My Links

News

Archives

Post Categories

Misc. Coding

Thought of it in the elevator...

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

Print | posted on Wednesday, September 26, 2007 8:22 PM | Filed Under [ .NET Random ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 5 and 5 and type the answer here:

Powered by: