Neph
2010-08-09 21:08:39 UTC
On my quiz one of my questions was:
16. Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will...
My answer was...
will cause an infinite chain of recursive calls.
If the recursive functions base case is 0
and the initial value is 3
and makes a recursive call with an argument n+1
the value of n on the next call will be 4 then 5 never reaching 0
therefore causing an infinite chain of recursive calls.
HE SAID...
No, it will return after a call of 3 recursive calls.
Can someone please clear this up for me, I'm going to talk to him about it Wednesday 9/11/10 . I just want to make sure I'm right about this before I confront him.
He will be sure to make me feel like an *** if I'm wrong and challenge him. So before I go through that again I just want to make sure I'm right. I got 19 out of 20 and this question was the one I got wrong.