[Tutor] exercise is recursion (more problems with my comp)

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Wed, 22 Nov 2000 13:36:23 -0800 (PST)

On Wed, 22 Nov 2000 alan.gauld@bt.com wrote:

> > It's been a very long time since I wrote a program that used
> recursion > (Hmmm...college...Pascal). I'd forgotten what a pain in
> the > butt it is to > debug. Any hints?

One of the obvious things to do is make sure that your function works on
base cases.  Also, you can try really simple cases where you already know
the answer, and make sure that your function duplicates these answers.  If
you compare outputs, that will often make it easier to see where the bug
is occuring.