> If you have tested the OP code, you would have noticed that he has essentially created a loop that counts from 0 to 4 million using a function that calls itself.
The code is written to stop when the result exceeds 4 million.
By my estimation that's a recursion level below 50. Nowhere near the technical warning level of 100 and certainly not a depth of 4 million.²
And this code does neither suffer of the problems of naive Fibonacci implementations, because it does only fork one recursive call, not two. (That's why it's passing so called @frames with the last two results and cleverly avoids the need of full memoization)
But I must admit that I haven't tested the code yet.¹ And I'm not sure what the count() does, (probably estimating for which input 4e6 is exceeded) °
But honestly it doesn't look like you know what you are talking about.
You sound like a flat earther criticizing a moon rocket because it doesn't have sails.
And I don't want to waist my breath explaining to you that there is no wind up there. Especially because you will claim then, that I've proven your flat earth theory
Update
°) that's the corresponding Euler Problem #2
¹) done -> Re: How am i doing?
²) actually it stops at Fib(35)
And FWIW I down-voted you for using those colorful markups.
|