开发者

Sorting the order of growth of the functions? [closed]

This question is unlikely to help any future visitors; it开发者_StackOverflow中文版 is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

Please order the function belows by 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?


That seems about right. As way of education, consider what happens when you feed in different n values (using rough powers of 10 rather than 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're list is correct.

  • 106 doesn't grow at all.
  • n log n increases its power-of-ten by one for each step.
  • n10 increases its power-of-ten by 10 for each step.
  • 2n multiplies its power-of-ten by ten each step.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜