2014年2月7日星期五

Week 5?

Recursion is more difficult than I expected. It feels like that recursion is the higher level of loop, more helpful under the complex restriction. We spent the whole lab in the first coding question but still not able to solve it out. Recursion is the process of repeating items in a self-similar way. For instance, when the surfaces of two mirrors are exactly parallel with each other the nested images that occur are a form of infinite recursion. And, it is said that often, a problem is easier expressed using recursion. This is especially true when you talk about tree-like data structures (e.g. directories, decision trees...).These data structures are finite in nature, so most of the time processing them is clearer with recursion.When stack-depth is often limited, and every function call requires a piece of stack, and when talking about a possibly infinite data structure you will have to abandon recursion and translate it into iteration.Especially functional languages are good at handling 'infinite' recursion. Imperative languages are focused on iteration-like loops. Hope I can handle it in the assignment...

没有评论:

发表评论