in Algorithms
467 views
0 votes
0 votes

How to solve the following recurrence relation?

T(n) = T(n-6) + n2 , n>7

T(n) = 1 , n<= 7

in Algorithms
467 views

4 Comments

$O(n^3)$ ?
0
0

using substitution method

you will get o(n3)

0
0

@adarsh @goxul

i got T(n)=1+132+192+252+............+n2

if it is right how to solve it further or if it is wrong then what is right ??

0
0
$T(n) = T(n-6k) + \Sigma_{0}^{k-1} (n - i)^2$, $n -6k = 7$.

Just expand the summation and you should get a $n^3$ term there.
2
2

Please log in or register to answer this question.