[ad_1]
f(N) is the sum of all integers which are less or equals to N.
f(N) = N + f(N-1)
= N + N-1 + N-2 + ... + 2 + 1
= N*(N+1) / 2
0
[ad_2]
solved Figuring out the complexity of the code
[ad_1]
f(N) is the sum of all integers which are less or equals to N.
f(N) = N + f(N-1)
= N + N-1 + N-2 + ... + 2 + 1
= N*(N+1) / 2
0
[ad_2]
solved Figuring out the complexity of the code