Hi Long time nooo see my lovely blog. I just want to share some of me thoughts on the idea of recursion... I found it's very very intriguing. Recursion is the process of repeating items in a self-similar way. It's a very useful and common application in computer science. Fibonacci sequence is a classic example of recursion. Fibonaccis sequence first appears in Indian Mathematics. The sequence is defined in the following term:
Fn=Fn-1 + Fn-2.
A Sierpinski trangle is also a classic example for recursion. This special form of triangle can be formed in the following steps:
1. Start with any triganle in a plane. Equilateral triangle can produce the best visual result.
2. Shrink the triangle to 1/2 height and 1/2 width, produce 3 shrunken triangles so that each triangle touches the two other triangles at a corner.
3. Repeat step 2 with each of the smaller trangles...
To understand recursion, I realize that there is a distinction between a procedure and the running of a procedure. Procedure is like a recipe, while running the procedure is actually preparing the meal. Recursion is part of algorithm, in that sense. One has to grasp the fundamental rule in one problem to solve or create a complex recursion system.
没有评论:
发表评论