Why is $\theta(n*log_{2}(n))+\theta(k*log_{2}(n)$ equal to $\theta(n*Log_{2}(n))$?

33 Views Asked by At

I've come across a problem.

If I have a row like this P = {1,2,3,4,5,6,7,8,9,10} and |P| = K.

How can merge sort & search be equal to the same as merge sort?

1

There are 1 best solutions below

1
On BEST ANSWER

The theta notation is concerned witht he behavior for large $n$. In this case, for large $n$, the ratio of $$ \frac{n \log_2n}{n \log_2n+ k \log_2 n} $$ approaches $1$ as $n \to \infty$. (Note that hohwever large $k$ is, eventually $n$ becomes a lot larger than $k$.)

So the expression in the denominator is not at all distinguished from the expression in the numerator under the "fuzzy asymptotic filtering" meant by $\theta(f(n))$.