here the algorithm :
s = 0
for i=1 to n do
s = s+i*i
return s
first time i thought it was sieve of eratosthenes's algorithm but i don't even know what i am learning
one more thing, can anyone write the optimization for this algo?
please help
Last edited on
Write a program - try it out.
Fairly trivial exercise. Not much to optimize.
Hint: what's another way to write i * i?
Last edited on
Right - I got lost in the word algorithm as a set of instructions steps. . .
Last edited on