Better time complexity.

130 Views Asked by At

I am new to complexity theory and want to know,

Which one is better time complexity(faster) for an algorithm ?? \begin{equation} n^{k+log_2(n)}/log_2(n)2^{n(n+1)/2} \end{equation}

or \begin{equation} 2^{O(n^{1/2}log^{2}n)} \end{equation}

where k is a constant. the first one, I guess?!!?

1

There are 1 best solutions below

0
On BEST ANSWER

I assume you mean that the first one is:

$$2^{n(n+1)/2} \frac {n^{k+\log_2(n)}} { \log_2(n) }$$ Then this is at least $\Omega(2^{n(n+1)/2})$ while the second one is at most $2^{O(n)}$. So the first one is much slower than the second.

If for the first one you mean instead: $$ \frac {n^{k+\log_2(n)}} { \log_2(n) 2^{n(n+1)/2} }$$ Then this is smaller than $O(1)$ and the second one is much slower.