Monday, November 25, 2013

week 11

After last week's lecture, I have gained a deeper understanding of recursion. In particular, we worked on the flatten recursion.
This excise is kind of straightforward. Here, (cons? L) produces true if L is a list, false then otherwise. So basically, you just need to substitute different number for L, and go through the conditions step by step.

Another tricky example,
however, I find that the number of the brackets inside the depth function determines the answer with other conditions being equal.

Wednesday, November 6, 2013

amazing recursion

Sierpinski's triangle
















example of recursion

image-width of the circle : the original radius is doubled