Which of the following shows a list of Big-Oh running times in order from slowest to fastest?

O(1), O(N), O(N2), O(logN), O(2N)

O(1), O(N), O(N3), O(2N), O(N!)

O(logN), O(N!), O(N2), O(N3), O(2N)

O(N!), O(2N), O(N2), O(N), O(logN)

Respuesta :

Answer:

O(N!), O(2N), O(N2), O(N), O(logN)

Explanation:

N! grows faster than any exponential functions, leave alone polynomials and logarithm. so O( N! ) would be slowest.

2^N would be bigger than N². Any exponential functions are slower than polynomial. So O( 2^N ) is next slowest.

Rest of them should be easier.

N² is slower than N and N is slower than logN as you can check in a graphing calculator.

NOTE: It is just nitpick but big-Oh is not necessary about speed / running time ( many programmers treat it like that anyway ) but rather how the time taken for an algorithm increase as the size of the input increases. Subtle difference.

Answer:

O(N!), O(2N), O(N2), O(N), O(logN)

Explanation:

ACCESS MORE
EDU ACCESS