Python Newbie Night vs. Recursion
by Leigh Honeywell on Feb.22, 2009, under Python Newbies
During last week’s python class we got to the part in our wonderful textbook where the concept of recursion is introduced. My friend Susan posted a witty line to my facebook feed regarding the teaching of recursion:
I normally teach recursion by checking to see whether they understand recursion, and if not, teaching recursion.
Within the class we have a variety of levels of experience with programming in general, and recursion in particular. I’m curious to hear peoples’ favourite recursion teaching tools, examples, or other witticisms. What’s your favourite programming problem to solve recursively?
-Leigh
February 22nd, 2009 on 6:11 pm
Recursion (ri-kur-zhuh) noun
See: Recursion
February 28th, 2009 on 6:16 pm
How about recursion in raytracing?
February 28th, 2009 on 7:52 pm
Fibonacci. It’s a great example because of the simplicity in the first implementation. It leads into recursion tree diagrams. You can explain how the stack works and why it’s overflowing. Finally, you can explain what an accumulator is.
March 25th, 2009 on 4:49 am
I usually translate the Scheme examples on this page into Python:
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html
In particular, the examples: “factorial”, “fib” and “count_change”. Maybe then add the tower of Hanoi.