Devise a recursive algorithm for computing n2 where n is a nonnegative integer, using the fact that

Question:

Devise a recursive algorithm for computing n2 where n is a nonnegative integer, using the fact that (n + 1)2 = n2 + 2n + 1. Then prove that this algorithm is correct.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: