Wednesday, 4 February 2015
Recursion Tracing
Learning about recursion for the first time last week was quite interesting actually -functions that call themselves? Sounded bizarre at first but with the sum_list function tracing problems practiced in class, it became quite clear how it worked. Tracing with the simple example presented in class was clear and I thought I had a firm grasp on the concept but with some of the functions in lab 3 and the question on today's test, my confidence wavered a bit as it took longer to figure out what the function should do and how much I should unpack it with every line. I do feel my confidence growing again though the more I practice tracing these types on functions. I can see how useful these type of functions would be extremely useful but I can't imagine writing one at this point...
Tuesday, 3 February 2015
Impressions (and Frustrations) Thus Far
Ending of week 4 and heading into week 5, I'd say it's a good time to backtrack a little on the situation so far.
Several elements have been covered so far including writing classes and subclass (of which there was a more than slightly frustrating assignment on, but I'll talk about that later, tracing recursive functions, and characteristics and methods of stacks. Most of the topics have been fairly straight forward with examples provided in class but there were a few aspects that remained blurry until it was necessary to implement them in the assignment. Specifically, the purpose and implementation of the __repr__() method. As it was absolutely necessary to implement this function in every class we wrote for the assignment, pushing off understanding it simply wasn't an option. After going over class notes, google-ing, and asking classmates, I finally figured out how to implement the method and was able to finish the rough bulk work for the assignment (yay~), that is, until the dreaded error messages starting appearing when I ran the program to test it......
Subscribe to:
Posts (Atom)