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

787. Cheapest Flights Within K Stops

Fluttering Dart: Functions

Relational vs. Non-Relational Databases

Do Not Try Another PDX Tech-Meetup Until You’ve Tried These Three

Docker Parameterized Builds Using Git Tags, Part 2 of 2

Web Scraping with Python 101

How Does Discord Process 5 Million Users All at Once?

Using Git LFS (Large File Storage) to Overcome the GitHub Size Limitation

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

Solve: Maximum Subarray

Oh, what of Big O notation and Complexity [Part 2]

Leetcode 34: Find First and Last Position of Element in Sorted Array

Linking Together Linked Lists