1
$\begingroup$

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?!!?

$\endgroup$
  • $\begingroup$ Is there a missing ordo in the first equation? $\endgroup$ – Artem Mar 12 '15 at 16:50
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.