View Single Post
  #4 (permalink)  
Old 05-01-2008, 08:41 PM
Zosden's Avatar
Zosden Zosden is offline
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
Heres a nice template for recursion

Code:
public <modifier> recusiveAlg(You need some sort of parameter) { if(some sort of stopping criteria) { return something; } else { return recursiveAlg(your parameter - 1) } }
Try to do this with Fibonacci numbers

hint: Fibonacci's numbers are the previous fib number + the one before the pervious fib number.
__________________
My IP address is 127.0.0.1
Reply With Quote