程序可以计算出一个算法的复杂性?复杂性、算法、计算出、程序

由网友(天暗下来你就是光)分享简介:有没有什么办法来计算编程算法的时间复杂度?例如,我怎么能计算出一个斐波纳契(N)功能?Is there any way to compute the time complexity of an algorithm programatically? For example, how could I calculate...

有没有什么办法来计算编程算法的时间复杂度?例如,我怎么能计算出一个斐波纳契(N)功能?

Is there any way to compute the time complexity of an algorithm programatically? For example, how could I calculate the complexity of a fibonacci(n) function?

推荐答案

在停机问题的不可判定说你甚至不能告诉我们,如果一个算法终止。我是pretty的肯定由此可以得出,你不能笼统地解决了算法的复杂性。

The undecidability of the halting problem says that you can't even tell if an algorithm terminates. I'm pretty sure from this it follows that you can't generally solve the complexity of an algorithm.

阅读全文

相关推荐

最新文章