Interesting week to say the least as an assignment is quickly approaching its due date.
The assignment is definitely more robust then those in 108, and I believe it gives ample practice, especially for those students who crave something to whet their programming lust.
Two interesting topics were discussed this week (though linked lists is admittedly 'old'). Recursion seems to require alot more experience than using the good ol' loop. Some additional thought is needed to properly structure problems into base cases and a 'recursive' case that can collapse the problem down to the base case. I'll definitely be adopting this slowly, before utilizing it heavily.
I found a great visceral live demonstration of this concept, it's called the Tower of Hanoi problem:
As the course seems to picking up pace, I'll have to increase my efforts towards this course accordingly. For now it's back to the assignment.
We had our mid term this week, and from what I've seen sentiments on it are mixed.
Some say that the exam was perfectly fine, while others say that it is way too long.
The common complaint was that it was very mechanical in the sense that most of the work was related to docstring writing.
My personal sentiment is that the exam could have been 10 minutes longer, but I'm willing to admit that I might have done better if I had written more class docstrings beforehand.
I was frustrated with myself for not answering the last question completely, as I realized how to do it properly the moment I walked out of the testing room.
Going forward I will ensure that I master the intricacies of any new data structures that are coming up, and to always be on the look out for challenging applications of them.
This week we reviewed the topic of container classes like the stack before diving into a very popular interview data structure, the Linked List. Though we knew how to make nested lists, making an entirely new class whose sole purpose was to imitate nested lists more effectively/efficiently was intriguing.
Stacks
I'm guessing the whole idea of a stack is to get us acquainted with thinking of programming problems as object based as possible. This week's parenthesis example was perfectly suited to the idea of a 'stack'; due to the scaling aspect of the stack as well as the intuitive nature of the solution. Because functionally speaking, you could do pretty much the same things you could do with a stack with a simple list. The usefulness will probably increase drastically for more complicated programs that require some kind of Last in first out storage system - a stack / sack class will certainly reduce the headaches of rewriting code over and over again.
Linked Lists
The professor went into some detail about why Linked Lists have certain advantages over regular lists using interactive activities. I truly appreciated a hands on teaching method as Linked Lists are quite abstract not to mention completely new concepts even for former 108 students.
Since we only briefly touched on Linked Lists, I scrounged for learning materials online and I found this video particularly helpful in supplementing the lecture material and website material:
Even though it's in C++, one could abstract from it the general idea behind nodes/linked lists very easily.
Another video I found particularly helpful is this one by Joe James from youtube. This video is specific to Python:
Another aspect of this week's material I found interesting was the usage of recursion to facilitate linked list searching. Recursion seems to solve certain problems more easily than using tons of loops; the problem for me is that figuring out the incremental algorithm that will collapse the problem to the base case has always been difficult to figure out.
I hope we get enough guidance so that we can be as fluent with recursive solutions as we already are with the loop variants.