A dream of recursion.

What is stack?

What is heap?

Ok, and then, what is recursion?

float _pow_recursion(float x, float y)
{
if (y == 0)
return (1);
if (y < 0)
return (_pow_recursion(x, y + 1) / x);

return (_pow_recursion(x, y - 1) * x);
}
_pow_recursion(2, 3).
if (y == 0)
return (1)
if (y < 0)
return (_pow_recursion(x, y + 1) / x);return (_pow_recursion(x, y - 1) * x);
if (y == 0)
return (1);
return (_pow_recursion(x, y — 1) * x);

Wrapping up:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store