mostlylucid

scott galloway's personal blog...
posts - 911, comments - 723, 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 ]

Comments have been closed on this topic.

Powered by: