I got following exercise:
An algorithm takes 0.5 ms for input size 100. How large a problem can be solved in 1 min if the running time is the following:
- linear
- O (N log N)
...
So the algorithm can process 100 items in 0.5 ms therefore 100*(2*1000*60) = 12 000 000 items processed for linear time.
Now how to solve 12 000 000 = O(N log N) for N? N = 2^(12 000 000/N)
And I'm stuck with how to eliminate the exponential N.
Also the exercise goes on:
- Order the following functions by growth rate, and indicate which, if any, grow at the same rate.:
N, square root of N, N^1.5, N^2 , N log N, N log log N, N log^2 N, N log (N^2), 2/N, 2N, 2N/2, 37,N^3, N^2 log N
As I don't have any solutions as reference here is mine:
2/N < sqrt(N) < 37< N=2N/2 < 2N < N log log N < N log N < N log (N^2) < N log^2 (N) < N^1.5 < N^2 < N^2 log N
Would be cool if someone could have look at it and correct me where i might be wrong.