DEV Community

But what is: Recursion? Recursion? Recursion? Recursion?

Adam Crockett 🌀 on June 25, 2020

Google recursion and you will find out exactly what it is, but if you have a moment I will try to explain what it is without going round in circles...
Collapse
 
briwa profile image
briwa • Edited

Google recursion and you will find out exactly what it is

When you google that, you'll find one of Google's witty jokes instead:

😂 or wait, maybe you actually meant to refer to this and I was completely missing the point...

Anyway, nice insights on the recursion! Thinking in recursion helps me reuse many parts of the code and simplify what could be a complex nested process.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Surprise 🥳🤣

Collapse
 
pankajtanwarbanna profile image
Pankaj Tanwar

Interviewer - Explain recursion, I will hire you.
Me - Hire me, I will explain recursion to you.

Collapse
 
iarmankhan profile image
Arman Khan

It's more like deadlock

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Indeed technically it's recursive as it does just go around in circles.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

The interview lasted for 65 years, unfortunately everyone died.

Collapse
 
marcoslooten profile image
Marco Slooten

Nice article, great to see some tree traversal. I also published an article about recursion three days ago (marcoslooten.com/blog/how-to-use-r...) and I wasn't sure if I could explain it with a tree so I used other examples, but you definitely made it understandable!

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Good on you Marcos, il certainly checkout your blog.

Collapse
 
coderific profile image
Yip

Another great recursion explanation at codeburst.io/learn-and-understand-...

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

Il take the implication that I did a good job too haha thanks 😅 I tend to write silly impactful 2min reads as I only blog on my phone.

Collapse
 
mikenikles profile image
Mike

Also check this article for a great explanation: dev.to/adam_cyclones/but-what-is-r...

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Ha!!! Very good 🦄