re: What’s a concept you understand now, but took you forever to grasp? VIEW POST

VIEW FULL DISCUSSION
 

Recursion . I understand that recursion is where a function calls itself, until it doesn't.
But given a problem statement, transforming it to recursive program is still difficult to grasp.

I understand that recursion uses stack frames to load the function.
Hence I too solve such problems like DFS (Depth First Search) using stacks and for-loops

 

I experienced the same as a CS student,lots of practice and use of recursion helped!

 

It took me so long to understand recursion, like 2-3 years before I felt comfortable thinking recursively. Making recursive solutions early on required just throwing shit at a wall and seeing what worked. Now it (recursion, not throwing shit at walls) is my favorite way to solve problems.

code of conduct - report abuse