Friday, 30 January 2015

Week Four

This week we began recursion.  I have previously only had minimal experience practicing recursion in java, so doing it again in python is a good exercise.  Fundamentally recursion is no different in java and python but because I never learned recursion in depth, this will basically be my first time practicing it extensively.  So far in lecture and the tutorial, we have only observed simple examples of recursion, mostly using functions to call themselves over items in a list.
To practice, we have been tracing out calls by hand.  It is important to write out the values on paper to properly visualize how the function calls itself, as with many mental exercises if you try to do it in your head, you increase the chance of making an error.  Reading over code instead of simply running it is invaluable to actually understanding how it works.  In class, we did the recursion exercises of a function sum_list, which was pretty straightforward.  Personally, i found the tree burst example more interesting.

No comments:

Post a Comment