Thursday 5 February 2015

W5: Re-re-re-re-cursion recap

    Clever functions they are, recursive functions. Really, it's inception, I think my first understanding still holds true, "code-ception". As I mentioned in last week's post, our "introduction" to recursion; this week was more of a hands-on experience. Tracing them in last weeks lab, as well as the in class exercises was good practice. I think, once you figure out the "pattern" or "trick", the rest is easy to see.

    Since our first term test was this week, working on my aid sheet also helped prepare me to be capable of writing code on paper. The night before the test, my fellow classmate and friend, Tim, and I were discussing as well as taking turns quizzing each other with content we predicted would be covered on the test. One thing I learned from him, because I didn't exactly trace the recursive question he asked me correctly, is to TEST until the pattern is discovered. Which actually makes pretty good sense, if you don't know what it does, throw something in and see what it spits out. I don't get everything like this *snaps fingers*, like some (most) of my cs friends but I try my best to figure it out and learn.
Still, there are times when this happens:
But practice, practice, and more practice! :)

    As for this week, we had one lecture on Monday, the test was Wednesday (which I thought was okay), and I just had my lab this morning. Today's lab, we focused on the A(bstract) D(ata) T(ypes)'s, stacks and queues. We worked first with Stacks, understanding their attributes and writing code to implement use of them, then we did a similar exercise with queues. The slight difference between Stacks and Queues lays in their LIFO and FIFO difference. Elements of Stacks follow the rule, "last in, first out", while Queues follow the, "first in, first out" rule (much like a lineup at Starbucks- first in line, gets their "java" first). In the lab I was also familiarized with the if __name__ == "__main__": block. Still, I always have my questions about programming :P
    

No comments:

Post a Comment