Sunday, February 8, 2015

Week 5. Tracing recursion impressions

    Tracing recursion calls is a task which requires a lot of concentration and can be tedious at first, but with some practice it becomes a lot more understandable and easier. First thing I thought was "why does this keep happening? There is no loop! Whyyyy?" And then "How does it know when to stop?" and then "I am dumb.". Obviously after couple of traces and attempts to write some recursive functions it became clear that a loop is absolutely unnecessary, since these functions call themselves, and have an if statement in them, so they kind of already are loops on their own.
    Knowing about this concept would have saved some time and effort in previous assignments in 108 and school, but it's understandable why nobody teaches it right away. It is hard to understand if you are not familiar and are able to use other concepts. Even now it is a bit hard, even though quick sort demonstration during the class helped with understanding of actually writing recursive functions a bit.
    Lab 5 handout looks like we are going to write some recursion functions, which is a bit scary, since I still didn't manage to make most of the ones I was practicing on work properly, but isn't it why we all are doing this? For that feeling in the end when you manage to make things work?
 

No comments:

Post a Comment