public static int function(int n, int a, int b){(adsbygoogle = window.adsbygoogle || []).push({});

if (n>0){

if(b==0)

return a;

else

return function(n-1,a,function(n,a,b-1));

}

return b;

}

I have a recursive function of this form, how do I convert it to a loop?

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Converting a recursion to a loop

Loading...

Similar Threads - Converting recursion loop | Date |
---|---|

Converting a DFA to efficient code? | Mar 11, 2018 |

Help: Convert Matlab to Python code | Dec 8, 2017 |

Java Recursive tracing java | Apr 4, 2017 |

Need to convert .f90 file to pdf | Jan 27, 2017 |

How to convert .m4v video to .png? | Jul 16, 2016 |

**Physics Forums - The Fusion of Science and Community**