Monday 23 March 2015

Week 11: Recursion revisited

No pun this time, just a few thoughts on how I've progressed through the semester on recursion. Reflections on my Week 5: Recurring thoughts about recursion.

Back when I started doing recursion, and after several simple examples/practice problems on basic recursion, I thought that I had a decent grasp on the concept. The examples mostly consisted of one simple check on types inside a list, with an else statement performing list comprehension on nested lists, which would then proceed to call itself and perform recursion.

Okay, so it's been 6 weeks, or roughly a month and a half of having extended my recursion knowledge and increased usage of recursion. Topics included mixing recursion with trees (trees, binary trees, binary search trees), linked lists, and with our second assignment on programming tippies.

Amendment: I'm not that good at recursion.

I had much trouble blending my ability to program trees and recursion. I couldn't really understand how the implementation of trees would be suitable for recursion, and even when I did, I struggled to implement them by myself. The examples seemed to flow so quickly and smoothly when Professor Heap performed them. This was also coupled with me not reviewing lecture material. Skip ahead a few weeks, and I managed to miss a few lectures on linked lists/binary trees. This didn't help my already lacking understanding of mixing recursion.

Quoting myself:

"""
Though I do struggle with some specific tree functions (such as the in_between exercise from lab #6), I do think that recursion can now be confidently added to my toolbox of useful Python tools. 
"""

I disagree wholeheartedly. Even after the second assignment and second term test, I realize that I still struggle with many of the recursive aspects of the newly introduced data types, for example, linked lists and trees, contrary to my own "update" on having "mastered" trees. Likewise, I still do hope to improve my own abilities and confidence on recursion, though with this SLOG post I'll refrain from commenting on my own prowess with such confidence.

1 comment:

  1. I totally understand that feeling. Having thought I managed to work out how recursion functioned, I was totally thrown for a loop for A2. Didn't have any idea how to break the mold of the simple list comprehension recursion model that was introduced to us in lecture and lab so I got extra confused on what the professor meant when he said to return multiple objects recursively. I'm still not 100% on recursive structure but I think an important concept is to unpack the recursive code to its most basic form.

    ReplyDelete