Friday, February 20, 2015

Finally, it's Recursion.



While browsing through the internet, I came across this image, and thought it's worth a mention here! Calling the function inside it's own definition, did seem weird to me at the start. They concept seems understandable, but I would need some more practice formulating the idea into code.

As we went through some of the tracing exercises, it helped me out to analyze the working behind the code. It was exciting to break down the code and realize how it splits into smaller bunch of problems and goes on doing so until it reaches to a certain result. There were multiple examples in the lab exercise which really helped to get grasp of tracing different kids of function. After going through them, it wasn't really hard to notice that, that each function involves some-sort of a pattern and an edge case. We need to encode that pattern and merge it up with edge case to make our function properly.

It is definitely a clever idea and  I hope in the next few classes, I can more ably understand the deadly-recursion. 

No comments:

Post a Comment