Saturday, 29 March 2014

Recrusion

     I have first encounter the idea of recursion in the forth week of csc148 classes. Through the first introduction reading, I thought the idea of recursion is very genius and fantastic. Recursion functions creates a loop or circulation that the function runs again and again within the function until it is instructed to stop.  
    The idea of recursion was complicated and I still think I need more practice to fully master it. As I have concluded, there are two ways of recursion. One is writing the function with in the completed full function like it is shown in the picture below.


The other form takes less words but more thinking. It is the abbreviate way of if statement. Here is an example below. 






No comments:

Post a Comment