retagged by
576 views

1 Answer

0 votes
0 votes

T(n) = T(n-1) + n4

                                           T(n)  -> T(n-1) -> T(n-2) -> T(n-3) -> -------- -> T(n-n) 

There are n levels which are decrementing by 1 at each iteration and stops at T(0) (assumption) . 

and at each level n^4 time is taken. Therefore, Time Complexity becomes n * (n4) = O(n5)

Related questions