Help solve a computational complexity problem

43 Views Asked by At

Find the tight computational time ($\Theta$ notation) complexity of the following function

enter image description here

Of course an exact solution is $\sum\limits_{i = 1}^{3{n^3}} {\frac{{2{n^3}}}{i}} $, but I am not able to solve this summation. Anyone can help with this summation or is there better way? Thank you!

1

There are 1 best solutions below

3
On

You can get as good an approximation as you want from $\sum\limits_{i = 1}^{3{n^3}} {\frac{{2n^3}}{i}} =2{n^3}\sum\limits_{i = 1}^{3{n^3}} {\frac{{1}}{i}} =2{n^3}H_{3n^3} =2{n^3}(\ln(3n^3)+\gamma+...) =2{n^3}(3\ln(n)+\ln(3)+\gamma+...) $.