Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Tail Recursion

Name: Anonymous 2011-10-19 21:09

How do i make this function tail recursive in java


public int fib(int n)
{
  return( n <= 1 ? n : fib(n-1) + fib(n-2) );
}

Name: Anonymous 2011-10-20 12:52

>>23
Yes, it's C++ and it's powered by Templates.

Now you should really should go back to /g/, cretin.

>>24
Ironically, Boost was developed to make C++ programming easier. However, Boost is mainly abusing Templates to no end, thus not only raping the processor when you compile it, but also making C++ slow as fuck.

Just don't use Boost, and you're fine.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List