Say I have a function which is written in recursive way which is costly way of doing the things. Now I want to convert the recursive function into iterative one. Is there a standard approach which can be applied to all the functions..
I think there is not standard approach, it depends, how complex the recursive function is?? But one thing is sure that it is always possible to convert a recursive function into iterative.