Friday, February 6, 2015

Tracing Recursion (Week 4)

During week 4, we were introduced to recursion - functions that call themselves. I looked recursion a little during my spare time in the Christmas holiday before the term started, and found it quite confusing. However, the lab exercise provided an opportunity to look at and trace through many examples of recursive functions and even have a go at writing a recursive function, which allowed me to establish a far better understanding on the topic. I have no trouble tracing recursive code in my head now. However, I haven't exactly gotten the hang of writing out the all of the steps and function calls when tracing code. I thought that being able through it in my head and figure out the output of functions would be enough, but I realized I was mistaken when I got my lab quiz back and I had lost half a mark for not writing down the steps. I think this may have cost me some marks in test 1 as well.

I plan on looking back at the lab exercise examples to familiarize myself with the format for writing down the steps when tracing recursive code so that I will be prepared if questions like that were to come up again in the future. I haven't done this quite yet because I have more midterms coming up, but I will do so as soon as I find the time.


No comments:

Post a Comment