3 ms·
> The only advantage of the for loop in this case is that there won't be stack overflow, but overall the recursive version will actually be faster. In language
by zelphirkalt 4y ago
> The only advantage of the for loop in this case is that there won't be stack overflow, but overall the recursive version will actually be faster.
In languages, which have realized the value of recursion, a stack overflow does not happen. For example: https://docs.racket-lang.org/guide/Lists__Iteration__and_Recursion.html https://docs.racket-lang.org/guide/Lists__Iteration__and_Rec...
- soegaard 4y agohttps://stackoverflow.com/questions/49912204/why-there-is-no-such-thing-as-stack-overflow-in-racket https://stackoverflow.com/questions/49912204/why-there-is-no...