2014年2月27日 星期四

Recursion

Have been talking about recursion from the begging of the semester and we have learnt a lot about recursion already. Recursion is basically calling the function again and again within the same function. Using recursion can help to break a complex problem down into smaller and simpler ones; getting smaller and smaller sub-functions until the problem can be solved.











The most simple problem is to sum up the integers in a nested list, other examples are Tree and LinkedList.









Using recursion really helps to solve "BIG" complex problems.

2014年2月16日 星期日

The Tower of Hanoi!! - week 6

Had fun with the Tower of Hanoi with four pegs ( the Reve's puzzle) these few weeks!!

We wrote a program to move cheeses around in at least four or more stools.
This was a bit challenging but was pretty fun.


This picture shows the begging of the Game.









I also learnt a lot form others' Slogs, they are fun and interesting to read too :)for example:

http://blogsteria.wordpress.com/
http://yyhcsc148.blogspot.ca/


HAHA
Oh! and is reading week, YEAH! Wish everyone have a fantastic reading and do a LOT of READING!!   :P

 

2014年2月5日 星期三

Week 5


More Recursion Function

So in this week, we learnt mare about recursion... Some examples like Tracing Turtle, Nested List, etc. they help me a lot to understand what and how recursion functions work.
tree_burst(4, 128, T)
Tracing Turtle



In the lab this week, we wrote some recursion functions, mostly about nested list and they are good exercises.


http://en.wikipedia.org/wiki/File:Tower_of_Hanoi_4.gif

Tower of Hanoi

Oh and I am now "Moving Cheeses" around! Wish me success on that... Tower of Hanoi, HAHA!