Sunday, 8 February 2015

my impressions of tracing recursion

Recursion plays a very important role in function design. It has some similarities with "when", which would have many repeated operations. However, there are still some differences between the two methods. As for "when", it need a valid value or statement so the function can go on running. But, recursion is used to work on one object (like list) which still has nested object (list), by this way, we can use very few codes get what we want for this original object including nested objects inside until the element is not the style of the object. Recursion is very useful and flexible and it can help programmer save a lot of time and energy.

No comments:

Post a Comment