Recursion, which I did not even know this
word until I took the lecture in week 4. Recursion means the functions that repeat
itself in functions body. This is just awesome and incredible. Apply itself time
and time again until resolving the function.
At the same time, the most magical part of recursion
is that the whole body just takes four lines in total, with no exception. Short
but powerful, that is my impression of recursion. That is why recursion
requires programmers a high level of logical thinking ability. Currently, all
about we have done is only tracing recursion. Even though, it makes me confused
from time to time while tracing the recursion. Concentration is highly
necessary when you do tracing recursion. In the lecture, the example that Mr.
Heap gave us is summing lists, which may contain nest lists, even nest lists in
nest lists… All he did was returning sum ([sum_list(x) for x in L]) (for which
sum_list is the function itself). Subsequently, the function will remove the parentheses
one by one time and get the sum for all the statistics in the list.
For now, the recursion is the most challenging
part ever since I learned computer science. In addition, I find it is charming
and I enjoy it a lot. I am looking forward the day when I create a recursion by myself.
No comments:
Post a Comment