# I am not able to understand recursions

**URL:** <https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783>\
**Category:** General\
**Created:** [October 2, 2020, 9:29pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783 "2020-10-02T21:29:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gururajankappa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gururajankappa/32/227426_2.png) [@gururajankappa](https://forum.freecodecamp.org/u/gururajankappa)\
**Post date:** [October 2, 2020, 9:29pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/1 "2020-10-02T21:29:59Z")

</div>

I can understand recursions that are shown to me (I learnt it recently). But I am not able to create recursions on my own. I have to look for the answer and blindly copy and paste. And then understand the code(I can do that, but I get stuck in that too). But when will I learn to create things on my own.  
I can understand complex stuff, only if the answer/solution/whatever is shown. Only then I can understand stuff.  
Could please help me by creating a few recursions to help me understand these better. This concept is really confusing and annoying me.

---

<div class="post-metadata">

**Author:** ![Naomi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/naomi/32/422181_2.png) [@Naomi](https://forum.freecodecamp.org/u/Naomi)\
**Post date:** [October 2, 2020, 9:56pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/2 "2020-10-02T21:56:12Z")

</div>

Hey there~!

I’m going to link to a post I made on another topic that includes a breakdown of how recursion works - let me know if this helps.

> [@Help please! Replace Loops using Recursion](https://forum.freecodecamp.org/t/help-please-replace-loops-using-recursion/415628/2):
>
> Hello~! Let me see if I can help explain it. First, the return 0 portion is the “base case”. A recursive function needs to have a base case, or it will continue on for infinity (or until the browser crashes). In order to understand recursion, we need to understand the call stack. As each function call gets generated, it is added to the stack. When the function calls end (because the base case is reached), the stack begins resolving. This happens in a “First-In-Last-Out” basis, or in the revers…

---

<div class="post-metadata">

**Author:** ![Diego\_Perez](https://avatars.discourse-cdn.com/v4/letter/d/f07891/32.png) [@Diego\_Perez](https://forum.freecodecamp.org/u/Diego_Perez)\
**Post date:** [October 2, 2020, 10:39pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/3 "2020-10-02T22:39:12Z")

</div>

Hi @gururajankappa

> Could please help me by creating a few recursions to help me understand these better. This concept is really confusing and annoying me.

You can use [http://pythontutor.com/](http://pythontutor.com/) if you want to “debug” (step by step execution) the code, here an example of recursion:

[![](https://img.youtube.com/vi/TjQYUVNiNRQ/hqdefault.jpg "Python tutor, freeCodeCamp Recursion Countdown, Example") ](https://www.youtube.com/watch?v=TjQYUVNiNRQ)

Cheers and happy coding 🙂

---

<div class="post-metadata">

**Author:** ![gururajankappa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gururajankappa/32/227426_2.png) [@gururajankappa](https://forum.freecodecamp.org/u/gururajankappa)\
**Post date:** [October 3, 2020, 7:44am UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/4 "2020-10-03T07:44:18Z")

</div>

I didn’t quite get anything.

Edit :- Oh! I got it now.

---

<div class="post-metadata">

**Author:** ![gururajankappa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gururajankappa/32/227426_2.png) [@gururajankappa](https://forum.freecodecamp.org/u/gururajankappa)\
**Post date:** [October 3, 2020, 8:02am UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/5 "2020-10-03T08:02:39Z")

</div>

Sorry for asking too many questions. Why should we :-  
return sum(arr, n - 1) + arr[n - 1];  
And return 0;  
If, at the end it has to return 0 anyways(when it reaches the base case).  
Why do we have to do:-  
arr[n-1] .  
How good of a programmer am I(I want a very honest answer, I won’t feel bad)?  
NOW this question might seem stupid to you. But you should know that I am not very good at math.  
Of course googling is good. But…I think your getting me…but we can’t google concepts(Unless we fully understand it)…we can look up for methods, css properties, “how to make a navbar” etc.  
I am able to understand the code. But I am not able to write a recursion on my own.  
Some more explanatory videos and explanatory replies will be appreciated.  
Could you teach me something common in all recursions. And then apply them to specific types of problems, and then apply THEM to specific QUESTIONS

I am so sad to say that I haven’t understood anything.  
I appreciate your hard work!

---

<div class="post-metadata">

**Author:** ![gururajankappa](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/gururajankappa/32/227426_2.png) [@gururajankappa](https://forum.freecodecamp.org/u/gururajankappa)\
**Post date:** [October 3, 2020, 5:18pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/6 "2020-10-03T17:18:19Z")

</div>

Just watch the whole video. You’ll learn everything you need to know(In detail)

[![](https://img.youtube.com/vi/lMBVwYrmFZQ/maxresdefault.jpg "Recursion Crash Course") ](https://www.youtube.com/watch?v=lMBVwYrmFZQ)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:38pm UTC](https://forum.freecodecamp.org/t/i-am-not-able-to-understand-recursions/423783/7 "2021-06-01T18:38:24Z")

</div>

Closed on June 1, 2021, 6:38pm UTC


