I wanted to see the impact of tail recursion optimization and want to write simple factorial function in a tail recursion optimized way.
Is it possible to do this in the code without compiler supporting it?
I wanted to see the impact of tail recursion optimization and want to write
Share
The compiler does the optimization. So it is not possible to test it without compiler support.
The only way to do this in code is to replace the recursion by iteration (but then of course you lose the recursion).