无标题文章

# Sort Complexities

## Aug. 17, 2016

Question

Sort the following complexities:

e^ne​n​​

n!n!

n^{100}n​100​​

n^nn​n​​

Hint

Think of what happens whennnis extremely large.

If in doubt, try to break the term into multiple multiplication steps.

Solution

It is pretty clear thatn^{100} < n^nn​100​​ 100n>100. It is also clear thate^n < n^ne​n​​ en>e.

What is fuzzy for many is where shouldn!n!fit in. Let us break the complexities down into smaller terms:

en=e×e×e×…×e×en!=n×n−1×n−2×…×2×1nn=n×n×n×…×n×nen=e×e×e×…×e×en!=n×n−1×n−2×…×2×1nn=n×n×n×…×n×n

As you can see above, asnngrows,n!n!easily overtakese^ne​n​​. Therefore, the answer is\enspace n^{100} < e^n < n! < n^nn​100​​

Below is a useful Big-O Complexity Graph for you to visualize how the number of operations grow asnnincreases.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 引言 这个周末,老姑从东北过来,到北京看房子。 因为老姑的孩子现在在国外上学,2019年博士毕业,预计到北京工作,...
    童_刚阅读 581评论 0 0
  • 运用工具是为了更快更好的解决问题,可太依赖一个工具,有时却容易陷进去,反而成了解决问题的障碍。 上周五,处理一个E...
    鱼儿圆滚滚阅读 682评论 0 0

友情链接更多精彩内容