时间复杂度混淆的下限

lower bound of time complexity confusion

本文关键字:时间复杂度      更新时间:2023-10-16

这是否有可能证明存在任何基于比较的排序列表搜索算法的时间复杂度下限?换句话说,任何将排序列表和元素作为输入并输出列表中元素索引(如果出现)的算法是否必须采取一定数量的步骤?

执行您建议的特定算法的公认方法是二叉搜索 https://en.wikipedia.org/wiki/Binary_search_algorithm,其平均时间复杂度为 O(log N)。 如上面的评论所述,在完美的情况下,该算法和许多类似的算法可以在一个步骤中完成。

一般来说,证明算法是优化的是一个难题,它涉及对算法进行分类或诉诸琐碎。 您可以在此处找到更多信息:

https://cstheory.stackexchange.com/questions/1284/problems-that-can-be-used-to-show-polynomial-time-hardness-results

这里:

https://cstheory.stackexchange.com/questions/2038/what-techniques-are-used-for-proving-algorithms-optimal

在这里:

https://www.quora.com/Is-there-any-known-way-to-prove-that-an-algorithm-is-optimal