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

橙三吉。 提交于 2019-12-11 12:27:36

问题


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?


回答1:


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.
  • 2nmultiplies its power-of-ten by ten each step.


来源:https://stackoverflow.com/questions/2669467/sorting-the-order-of-growth-of-the-functions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!