Sunday, 8 February 2015

Recursion(Recursion(Recursion()))

So in week 4 I was first introduced to the concept of recursion using Python. Although I have heard about recursion in the past, I did not really know much about how it worked until now (the only thing I used it for before was factorials). It seems like recursion is somewhat important to know however so far I haven't really seen the need for it. Everything we did in class so far could easily have been done without recursion, and I am not actually sure what it is really used for. Regardless, the concept was not difficult to grasp and it makes you think about what other sorts of 'tricks' computers can be programmed to do.

I found that tracing the recursion on paper made understanding what was going on easier than just being told what was happening. Using the method of tracing that was taught in lecture like a type of rulebook, even the most complicated examples could easily be traced and understood. Although, I still find it odd that every recursive function we made did a list comprehension, despite this not being a requirement whatsoever. In addition, I personally found it a bit confusing when we were told to replace "identical calls" instead of tracing. I was never sure at which point to replace the recursive call, so I had a big inconsistency there. Overall it was relatively straight forward, but again like my last post, I wish we could have done some better examples/questions. Maybe analyzing very large recursive call run-times (10 000+ calls?), or even seeing practical applications for them. Lastly, I never seem to understand why in a computer science class students would be expected to trace code by hand. It honestly baffles me as to why paper even enters that lecture room. Considering that computer science may or may not having something to do with digital machines, it would make too much sense to do the tracing using a computer. It could be that students are not expected to bring computers to school, but then one could have been mentioned for those that do.

No comments:

Post a Comment