What is Recursion?!

What is a recursion?

Infinite recursion

def recurse():
recurse()

Why use recursion?

def recurse(x):# base case:   
if (x == 4)
return(1);
recurse(x - 1)

How to use recursion?

  • a recursive call
  • base case.

Let’s see an example below:

functions that’s use recursion
example of the recursion
heap until the stop cnditional is true
In here we can se that the result will be x*x*x (y times)

Conclusion:

--

--

--

Software engineer in progress

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

Recommended from Medium

System Design Interview Patterns-II

How to properly play Wordle using Dataflow and BigQuery.

Web Assembly + Go

Functional Options in Go: With Generic

Finding Balance as a Programmer

Understanding indicators used to measure health quality

png

Welcome To Sin City

Complete version list of apps used throughout Extortionist’s creation

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
Katherine Soto

Katherine Soto

Software engineer in progress

More from Medium

Understand the concept of recursion

BackTracking(1) / Algorithm

Hackerrank — Abstract Classes — Polymorphism Solution — C++

Data Structure: Arrays and Lists (II)