Q. Consider square numbers defined as follows:

 

compute(1) = 1

compute(N) = compute(N-1) + 2N - 1

 

According to this definition, what is compute(3) ?

 

(a) compute(3) = compute(2) + compute(1)

(b) compute(3) = compute(2) – 2*3 +1

(c) compute(3) = compute(2) +2*3 -1

(d) compute(3) = compute(3) +2*3-1

 

Answer =

Option (c) is correct.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post