Sorting the growth order of functions?

Please order a function that matches the growth rate from fastest to slowest:

  • n ^ 10
  • 2 ^ n
  • Nlog (n)
  • 10 ^ 6

And my answer is:

  • 2 ^ n
  • n ^ 10
  • Nlog (n)
  • 10 ^ 6

Is my answer correct?

+1
source share
1 answer

That seems right. As a way to learn, think about what happens when you use different values n(using coarse 10 values, not exact values):

 n      2^n       n^10    n log n   10^6
 ----   -------   -----   -------   ----
    1   10^0.3    10^0    10^0      10^6
   10   10^3      10^10   10^1      10^6
  100   10^30     10^20   10^2      10^6
 1000   10^301    10^30   10^3      10^6
10000   10^3010   10^40   10^4      10^6

So, in terms of how fast they grow, you are the right list.

  • 10 6 not growing at all.
  • n log n increases its capacity by ten per unit for each step.
  • n 10 increases its power by ten by 10 for each step.
  • 2 n .
+3

Source: https://habr.com/ru/post/1741781/


All Articles