Skip to content
Prev 240035 / 398500 Next

Recursive algorithm

On Nov 1, 2010, at 6:12 AM, Megh Dal wrote:

            
res[2:(10000+1)] <- res[1:10000]*mysteryfunction(2:(10000+1))    #  
might work if you created res as length 10001.


  In the current situation you should have been getting an error that  
you are not telling us about when you got to the end and tried to  
assign to res[10001]. Anyway, it's more likely the case that the  
mystery function is eating up time rather than the loop.