This week we're moving on to another topic - recursion! It's simply like some functions use themselves as a helper function, and due with some very special situation. Like sum the list
[1, [2, [3, [4,[5]]]]]. I think recursion is like the key to solving the puzzle. It uses some special pattern to solve the puzzle. Besides, we also learnt how to make track to the recursion function, which can help us to understand how recursion works and how to write a recursion function.
I was wondering whether there're some trick to create a recursion function since I know how to track the function, but I have difficulties while writing some slightly complicated recursion. For example, the last question for the lab exercises in this week. I prefer some logical and detail tips like first step should do what and the second step should do what, etc.
没有评论:
发表评论