Sunday, 8 February 2015

Week 5

Last week was our introduction to recursion. We were told that this is a widely useful concept in programming, and already began to experience this for ourselves during the lab. So far, we have mostly been tracing recursion, as opposed to writing our own code, though the lab did include one such question. Surprisingly, by the time my partner and I had finished tracing all of the examples, we did not have too much trouble implementing our own recursion to find the maximum length of a list from the input. I will want to practice writing docstrings for recursion, as I currently still find them a little tricky to understand and create myself.
When tracing recursion, I have found it helpful to write the steps out by hand. This allows me to carefully analyse each step and understand what the code does, so that I can ultimately correctly determine the output.
Though this is not an easy concept to wrap my head around, I am confident that I can quickly become more comfortable with recursion with a bit more practice.

No comments:

Post a Comment