0 votes
T(n) = R(n-1) + n log n
R(n) = T(n-1) + n^2
in Branch & Bound by AlgoMeister (1.6k points)

3 Answers

+1 vote

Given R(n) = T(n-1) + n^2 

so, R(n-1) = T(n-2) + (n-1)^2

T(n)= T(n-2) + (n-1)^2+nlogn
T(n) = n^2 + (n-1)^2 + (n-2)^2...

The sum of squares of k numbers is k(k+1)(2k+1)/6  which is order of k^3

Hence T(n) = n^3

by (144 points)
edited by
Some of the math terms seem to be slightly off in the beginning, other than that it looks fine.
+1 vote
T(n)= T(n-2)+(n-1)^2+n*log(n)

Since n*logn is asymptotically compared to (n-1)^2

T(n)=T(n-4)+(n-1)^2+(n-3)^2

T(n)= c+(n-1)^2 + (n-3)^2 + ... [ where c is constant]

T(n)= O(n^3)

Now R(n)= R(n-2) + n^2 + (n-1)*log(n-1)

Since n*logn is asymptotically smaller compared to n^2

R(n) = R(n-2) + n^2

R(n) = n^2 + (n-2)^2 + (n-3)^2 + ....

R(n)= O(n^3)

Hence T(n) = Theta(R(n))
by (220 points)
0 votes
T(n) = T(n-2) + (n-1)^2 + n log n

R(n) = R(n-2) + (n-1) log(n-1) + n^2

solving T(n): we get T(n) = n^2 log n

solving R(n): we get R(n) = n^3
by AlgoMeister (900 points)
edited by
The Book: Analysis and Design of Algorithms | Presentations on Slideshare | Lecture Notes, etc
...