int foo(int n) //Line 1{ //Line 2 if (n == 0) //Line 3 return 0; //Line 4 else //Line 5 return n + foo(n - 1); //Line 6} //Line 7
Consider the accompanying definition of a recursive function. Which of the statements represents the base case?
A. Statements in Lines 1-6.
B. Statements in Lines 3 and 4.
C. Statements in Lines 5 and 6.
D. Statements in Lines 3, 4, and 5.
Answer: B
Computer Science & Information Technology
You might also like to view...
Which field is like an FYI and generally means that a reply isn't expected?
a.Bcc b.Cc c.Fw d.To
Computer Science & Information Technology
An embedded style sheet takes precedence over an external style sheet.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology