Saturday, 1 February 2014

First Impression about Recursion

    In the week,I mean week#4, we formally started learning recursion. 
    Defined by the Python 3 document, Recursion means defined something in terms of itself(usually in smaller scale) to achieve objective in multiple times.
It is like the picture showing below.



Showing from the picture,the recursion is like a chain of endless order.In class,first of all,we dealt with the simple list,then nested list. Those nested list gave me the first impression of recursion,which is its high efficiency and concision.For only one line of code all items in nested list can be sorted.And amazingly, fit in every kind of item.
But I still haven't written my own recursion code yet,I think I have to rigorous about determining where is the recursive part.It could be like for loop or while loop,I guess.

No comments:

Post a Comment