Tuesday, December 1, 2009

Recursion

Decided to discuss on this since I realized some of you didn't get it when I posted at the forum earlier on.
Anyway.. I think all of us should have learnt what is recursion about, right?

Recursion is a method of defining function in which the function being defined is applied within its own definition. It is more generally used when describing a process of repeating object in a self-similar way. It is usually solved by solving the smaller instances of itself.

A visual form of recursion would be called as the Droste Effect.

In the picture above.. the lady was holding a cup and a container which have the smaller version of herself holding the same objects on them, which then in turn contain the even smaller version of herself holding the same objects.... and so forth

Google showed us how is it being done in a humorous way.
Try google the word "recursion", it will return you "Did you mean recursion?" for endless times, no matter how many times you re-spell the word and click on to the suggested link.
Well, it has just perfectly demonstrated us how does a recursion that has no base cases work! :) (i.e. infinite calls)



have fun trying!


References/Images:
Wikipedia
Google

No comments:

Post a Comment

Followers