Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

f(n)=n^log(n) complexity polynomial or exponential

I'm trying to figure out whether f(n)=n^(logb(n)) is in Theta(n^k) and therefore grows polynomial or in Theta(k^n) and therefore grows exponentially.

First I tried to simplify the function: f(n) = n^(logb(n)) = n^(log(n)/log(b)) = n^((1/log(b))*log(n)) and because 1/log(b) is constant we get f(n)=n^log(n).

But now I'm stuck. My guess is that f(n) grows exponentially in Theta(n^log(n)) or even hyper exponentially because the exponent log(n) is also growing.

like image 307
tetractis Avatar asked May 01 '11 20:05

tetractis


People also ask

Is n log n considered as polynomial?

Yes, O(nlogn) is polynomial time. From http://mathworld.wolfram.com/PolynomialTime.html, An algorithm is said to be solvable in polynomial time if the number of steps required to complete the algorithm for a given input is O(n^m) for some nonnegative integer m, where n is the complexity of the input.

Is n log n exponential?

Any algorithm whose time complexity function cannot be so bounded is called an exponential time algorithm (although it should be noted that this definition includes certain non-polynomial time complexity functions, like nlogn, which are not normally regarded as exponential functions).

What is the time complexity of n log n?

It has a guaranteed running time complexity of O ( n l o g ( n ) ) O(n \ log (n)) O(n log(n)) in the best, average, and worst case. It essentially follows two steps: Divide the unsorted list into sub-lists until there are N sub-lists with one element in each ( N is the number of elements in the unsorted list).

Which algorithm has the complexity of on log n?

Examples of O(N log N) algorithms: Merge sort, Heap sort, and Quick sort.


1 Answers

You can write n^(log(n)) as (k^(logk(n)))^(log(n)) = k^(K*(log(n)^2)). Since (log(n))^2 < n for n large enough, then this means that n^(log(n)) will grow slower than k^n

like image 130
Himadri Choudhury Avatar answered Oct 25 '22 04:10

Himadri Choudhury