Re: Is this recursion?



On 30 Jan 2007 02:19:33 -0800, Marion wrote:
I wrote a simple program that reverses a word that doesn't have a
base step but it calls itself. Would this be considered by the
formal defintion of recursion?

You claim that it works correctly, so I claim there is in fact a base
case (without which it would continue recursing forever).

In your code, you only recurse conditionally (when position != 0).
What happens otherwise? That's your base case.

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.