130k views
2 votes
The square of n can be calculated by noting that square(n) = square(n-1) + diff(n-1). diff(n) = diff(n-1)+2. The square(0)=0, diff(0)=1. What is the stopping condition for this recursive definition?a. unknown b. n=1 c. n=-1 d. n=o

User PunitD
by
7.0k points

1 Answer

2 votes

Answer:

d. n=0

Step-by-step explanation:

The recursive definition stops when the variables square and diff are attributed fixed values.

It happens at n = 0, as square(0) = 0, diff(0) = 1.

So the correct answer is:

d. n=0

User EddyLee
by
8.3k points