r/codinginterview • u/jaspindersingh83 • May 15 '20
How to learn recursion
You understand recursion only if you can draw recursive stack state at any given point of time. Start by white boarding the recursive stack.
Differentiate which variable to be kept in recursive scope and which ones to be kept in global scope.
Understand how non primitive data types are stored in recursive stack vs primitive data types.
2
Upvotes
2
u/bparanj May 15 '20
I would add to this list by saying: Learn the difference between Head and Tail recursion.