为O(log n)的总是快于O(N)

编程入门 行业动态 更新时间:2024-10-21 22:52:42
本文介绍了为O(log n)的总是快于O(N)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如果有2个algorthims计算相同的结果,不同的复杂性,将O(log n)的永远是更快?如果是的话,请解释一下。顺便说一句,这不是一个问题分配

If there are 2 algorthims that calculate the same result with different complexities, will O(log n) always be faster? If so please explain. BTW this is not an assignment question.

推荐答案

没有。如果一种算法的运行N / 100 ,另一个在(日志N)* 100 ,然后第二个会慢一些较小的投入规模。渐近复杂性是关于运行时间行为作为输入尺寸去到无穷大。

No. If one algorithm runs in N/100 and the other one in (log N)*100, then the second one will be slower for smaller input sizes. Asymptotic complexities are about the behavior of the running time as the input sizes go to infinity.

更多推荐

为O(log n)的总是快于O(N)

本文发布于:2023-11-29 16:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646957.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:快于   log

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!