Last week we started learning about recursion and I found the concept to be relatively easy. The idea is that a function continuously calls upon itself which is a very powerful tool we can use in solving complex problems that we could normally not accomplish through writing simple python code. For example it could be used to count the total number of elements in a list or even a list of lists. Recursion is so powerful that many programmers today use it on a daily basis and I believe that if I can get a solid grasp on this topic, I will be very successful in my future programming career. Despite understanding the concept of recursion, I always have trouble coming up with the correct algorithm in which I can translate into python code for complicated recursive functions because it's pretty hard to think of what specific things I need the function to do each time it is called. To improve upon this I'm planning to practice tracing more recursive functions to the point where I can clearly visualize what each call will do without having to write it out.
On another note, we also had our first midterm this week which I felt I did a pretty good job on. However, I feel like I could have done better had I coded a bit more since I completely forgot what to put in methods that were meant to be abstract and overridden by subclasses. I now know that I should have wrote an exception or perhaps put pass instead of writing something that had no correlation to the question whatsoever. Another thing I should probably do next time is study a bit more since I ended up sleeping all night due to the fact that I was dead tired from staying up the previous night studying for a psychology midterm.
No comments:
Post a Comment