Sunday, February 16, 2014

Week 6: ~Trees~

At the beginning of this week, I finally finish my assignment 1~ :) It is very challenging to use recursion to find i, but I finally find a way to do it, that is to record the i and move at the same time.

Lab was about test cases. I forget how to write a standard test case, my partner and I spend some time google them. After reading several examples, we figured them out. After lab, I did some review on the test case.

Lectures was about recursion. We learned more on recursion this week. The structure of trees is a brand-new topic. We learnt about pre-order traversal, in-order traversal, post-order traversal, and how to use recursion and trees together. Reading and understanding code seems easy to me, but I need more practice on writing recursions on my own.

Also, test 1 is coming soon. I want to spend some time to review the stuff I have already learnt. So far, I enjoy this course very much :)

Saturday, February 8, 2014

Week 5: Tower of Hanoi and some recursions

This week, I put a lot of effort to assignment 1. Tower of Hanoi is an interesting question, and I am surprised that computer can help us to solve it in such a clever way (if you told the computer to do the right thing).

Our job is to program a game with four stools. The most challenging part is to find the least moves, which will involve recursion. In Monday's lecture, we got some idea of three tools recursion.  In Wednesday's lecture, we learnt some thing about global and local values. If a function is inside anther function, then the values it produces will probably be local without using "global". It might be useful in assignment 1 I guess.

Labs are about tracing recursions. I think tracing is easier than actually writing the code. Because, to me, tracing is the first step of writing codes. Before writing codes, I prefer to write some examples, which is exactly what tracing will be.

Although the course is getting harder, I found it really interesting.