some notations in algorithm analysis

332 Views Asked by At

Assuming $k$ is a variable,

1.then someone claims that the algorithm complexity is super-linear or sub-linear in $k$, here what is the meaning by using super-linear or sub-linear?

2.also, if someone claims that the algorithm complexity is $m$ times the best algorithm. For $m$, it can be $m=k+o(1)$ or $m=k+O(1)$, $m=k+\Omega(1)$, $m=k+\Theta(1)$, so here what is the meaning of $o(1), O(1), \Omega(1), \Theta(1)$ ?

1

There are 1 best solutions below

0
On

If $n$ is size of input, and $T_n$ the time it takes.

Super linear time means faster than any $C\cdot n$, i.e. $\limsup T_n/n=\infty$. Examples $T_n=n\ln(n)$, $n^2$, $n^n$ ...

Sub linear time means slower than $n$, i.e. $\limsup T_n/n<\infty$. Examples $T_n=\sqrt{n}$, $\ln(n)$, ...

$o(1)$ is something that tends to zero, $O(1)$ is something bounded above by a constant, $\Theta(1)$ is something bounded above and below by non-zero constants. $\Omega(1)$ it depends. See here for all those definitions.