Week 7: Recursion and Trees
As we just began recovering from brain exhaustion as a result of our first assignment/program, the course takes no mercy on us as it bombards us with yet another assignment. I hear my brain fart, as I mentally hard reset it to get it working for the next wave of impact. Jokes apart, I’m happy that we get our next chance to apply what lessons we learned from assignment one. Not taking this one easy, our team has already started reading through the handout and taking notes for this assignment.
Week 6 introduced us to recursion leading straight into week 7 where we solidified this concept and applied this in programming using trees. The thing I found really interesting and crucial to the understanding of trees was the analogies that were made by our professor in order to motivate this concept (for example, children, leafs, roots, etc.). Although recursion in itself was an intriguing concept, the way we write it all in one line using list comprehension and shorthand “if, else” statements is mind blowing!
I didn’t really have much of a problem picking up the intuitive idea of recursion. Moreover, tracing many examples of how inputs are processed using recursion really helped me in getting a deeper understanding such as the exercises we were given in class before we actually tried programming them. A crucial thing our professor stressed in the tracing was not to go too deep when tracing a nested list as it made things more confusing. Some functions get confusing especially because of how many things we’re doing in one line. I am still familiarizing myself with how to incorporate functions such as “any”, “max”, etc. to write efficient recursion code.










