2014年3月2日星期日

csc148 SLOG5: Recursion

Still, I am not doing good in recursion. For most of the time, I can understand the question well and represent the operations in English or math, but I don’t know how to translate them into Python. For example, I failed to write the best recursion in assignment one to operate the cheeses in the smallest steps.

Recursion itself is not something hard to understand. It is like a function that has only one kind of base operation, and the rest are guiding the function itself to the base operation. So simple cases are fine for me. It is just a choice whether the function should do the base operation or keep on entering itself to choose again with some simple indirect edit. But when facing complicated ones or when recursion is just part of the program, I feel struggling. 

I have done many practices on deciding base cases. It looks good. Now I should start to practice translating, those small edits before the function reenter itself. 

没有评论:

发表评论