Tuesday, 18 February 2014

Week 6: Trees

Most of this week was spent finishing A1.  I don't even remember how many hours I spent figuring out the recursion in tour.py. Getting the function to be efficient was incredibly challenging, but I think I succeeded. This assignment has definitely honed my recursion skills.

Moreover, this week, we learned about trees. Trees are composed of roots, branches and leaves. Roots are parents of children, and branches connect parents to children. Nodes with no children are called leaves. Each child can just have one parent, and each parent can have a maximum of 2 children. The tracing of trees is done through recursion. They seem like a nifty way of handling and manipulating information and I look forward to getting more familiar with them.

Saturday, 8 February 2014

Week 5: Assignment 1

This week, I started Assignment 1. I had to go over the assignment handout a few times, before I began to comprehend it. I know that the story at the beginning is supposed to make A1 seem like more fun, but it ended up just confusing me. So far, I am finding the assignment fair. I am done TOAHModel.py and am going to start ConsoleController.py tomorrow. Steps 1-4 did not take me a lot of time. However, I was stuck for quite a bit on the top_cheese function. After some investigating, I realized that the error lay in my __init__method, which I promptly fixed.

I know that the next part of A2 is more challenging as we have to use more advanced topics such as recursion. I am still not entirely sure if I understand recursion. Sometimes, I feel extremely confident in my ability to use recursion, whereas at other times, I feel completely lost. Furthermore, We went over the Tower of Hanoi recursive code in class today. It's interesting how recursion can provide the fastest way to complete the game. However, I do not think I followed entirely in class and I plan on going over the code tomorrow, as it is apparently useful in the second part of the assignment. I will delve into more detail about recursion in week 7, when it is the assigned SLOG topic, and hopefully, I will have a better grasp on it by then.