This week I've learned about nested list recursion and how to implement them inside methods. I also struggled with the first assignment, I kept getting an error that would only show on IDLE whenever I'd execute the PyGame module, stopping me from seeing any listed towers of cheese. I spent a lot of time going back to old notes in order to get a fresher point of view in order to do the assignment. I am also preparing for the midterm at this point.
Recursion has been my greatest challenge, it took me a very long time (and I still struggle with it) to grasp the more difficult uses of recursion. I understand the concept very well and am able to solve simple methods easily but I need to deepen my understanding on how recursion works exactly.
Interesting SLOG of the week:
http://veraslog.blogspot.ca/
Quite a gem of a blog I found this week with each entry being bulky (not in a bad way) and rich in details. Vera (I'm assuming) answered the question assigned to us by Danny about recursion and OOP( object oriented programming). He/She wrote such a great definition for recursion that I need to post it here:
"Recursion is an unusually simple but difficult concept to grasp. It’s an extremely efficient way to handle certain situations but is often neglected or overlooked. My programming teacher in high school always said “You either understand recursion or you don’t. Usually it just hits you one day and you get it”. The “What is recursion?” question is regularly asked by programmers. If you search on Google, you get a variety of answers ranging from “Recursion is a method where the solution to a problem depends on solutions to smaller instances of the same problem” or “Recursion is the process of defining a problem in terms of itself”. In other words, recursion is a function that calls itself a number of times. It is important because it allows programmers to efficiently solve a mathematical model/algorithm that has definite boundaries/parameters. There are a variety of examples where recursion would prove handy such as; traversing trees, modelling mathematical formulas such as factorials (our Towers of Hanoi algorithm too!), fractals, etc. Recursive functions are usually easier to read and understand than solving with loops. Other benefits are that it’s simple, uncomplicated, and time-efficient as opposed to loops."
No comments:
Post a Comment