例如阶乘时间算法澳(N!) [英] Example of a factorial time algorithm O( n! )
问题描述
我在学校学习的时间复杂度和我们的主要焦点似乎只处理的多项式时间的算法和准线性时间的偶尔<算法EM>指数时间的算法的运行时间的角度来看一个例子。但是,处理较大的时间复杂度从未被覆盖。
I'm study time complexity in school and our main focus seems to only deal with polynomial time algorithms and quasi-linear time algorithms with the occasional exponential time algorithm as an example of run-time perspective. However, dealing with larger time complexities was never covered.
我想看到一个例子问题与运行中的阶乘时间的。该算法可以是一个幼稚的方法来解决问题,但不能人为臃肿的阶乘时间运行。
I would like to see an example problem with an algorithmic solution that runs in factorial time . The algorithm may be a naive approach to solve a problem but cannot be artificially bloated to run in factorial time.
额外趋之若鹜如果阶乘时间算法是最好的已知算法来解决这个问题。
Extra street-cred if factorial time algorithm is the best known algorithm to solve the problem.
推荐答案
您 N!
列表,这样你就不能达到提高效率的 O(N!)
。
Generate all the permutations of a list
You have n!
lists, so you cannot achieve better efficiency the O(n!)
.
这篇关于例如阶乘时间算法澳(N!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!