Consider the following recursive algorithm for computing the sum of the first $n$ squares: $\sum \limits _{i=1} ^n i^2 = 1^2 + 2^2 + \cdots + n^2$.
Algorithm:
SUM(n)
if n = 1 return 1
else return SUM(n − 1) + n ∗ n
Write the recurrence relation for above algorithm and solve it using the iteration method.
HINT The result will look like a poylnomial of third degree:
$$ \sum_{i=0}^n i^2 = an^3+bn^2+cn+d $$ Calculate three more values by hand (you already have $n=1$) and find the coefficients...