Saturday, 17 August 2013

The time complexity of O(n^n) and O(n!)

The time complexity of O(n^n) and O(n!)

Get the complexity order of below {O(1), O(log(n)), O(n*log(n)),O(n),
O(n^2), O(2^n), O(n!), O(n^n), O(n^3).
The order should be below: O(1)< O(logN) < O(N)< O(NlogN)< O(N^2)< O(N^3)<
O(2^N)< O(N^N)< O(N!)
In my opinion, N^N = N*N*N.... however, N! =N(N-1)(N-2)..... so O(N^N) < N!
However, another friend said O(N^N)
I dont know how to get this, please explain more about this.
Thanks very much.

No comments:

Post a Comment