# I am not able to understand recursions

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.

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.

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/ if you want to â€śdebugâ€ť (step by step execution) the code, here an example of recursion:

Cheers and happy coding

2 Likes

I didnâ€™t quite get anything.

Edit :- Oh! I got it now.

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.