Sunday, February 1, 2015

week 4, recursion

    As stated on topic of this week, we started to learn the concept of recursion in python, and it is a very interesting way of solving problem which can only be done by computer. From my understanding of recursion, it is a method of solving problems recursively by breaking a single problem into many single parts and solving them one by one. Furthermore, the first example that our professor gave us when we started recursion is the sum_list method. 
    The function of this method is to sum up all elements of a given list and the elements in it's sub-list. The body of this function can really gave people a headache for those who first seen how recursion works, because the functions calls itself within the function which seems mind blowing! The time for getting how this method works for everyone is different, some people might think about this for days and months or even years and still can't get how recursion work, but this really depend on how everyone's mind work. For me, the word recursion was first heard when i am studying computer science in high school and at the end of the year, our teacher gave us a peek on how recursion works with it's recursive case and terminal case, she even put this on the final exam! This concept i understood in days and i guess a "normal" geek can also do so.
    To conclude, since i already know how recursion worked this week's lecture wasn't that abstract for me and the practical also went smoothly. 

No comments:

Post a Comment