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:

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Interesting Design & Dev Links — April 2018

Perlin Noise and Unity Compute Shaders

Docker - Common Monitoring Solution One

READ/DOWNLOAD$? Agile Project Management For Dummi

[058] LeetCode 122演算法【Best Time to Buy and Sell Stock II】 股票機器人 II

Code Algorithms

Building a CLI Gem — or how I learned to stop worrying and love binding.pry

My DSAID internship experience

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
Flavio Orlando

Flavio Orlando

More from Medium

Communication between two separate GUIs via Multi-Threading

Solution for Range Sum Query 2D immutable ( Easiest and Smartest Method 😎 )

Chapter 16 Greedy Algorithms

Algorithms Used for Efficient Multiplication of Large Numbers