[Edu-sig] understanding recursion. . .
kirby.urner at gmail.com
Thu Feb 8 20:19:40 CET 2007
But they don't have any clue that there's a call stack involved, or that
someday this could get them in trouble. I shudder to think about the
blank looks that I will get if I try to explain why it could be a problem.
I'd praise those stumbling on recursion, use the opportunity to talk about
it more specifically, and about how some languages are based on it rather
intensively (others not so much).
Greatest Common Divisor may be written both ways:
a, b = b, a % b
return gcd(b, a % b)
But of course if your 10th graders are pathologically math phobic,
like so many of their college peers, you'll want to eschew any
such examples and deal purely with strings.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Edu-sig