例如阶乘时间算法澳(N!) [英] Example of a factorial time algorithm O( n! )

查看:252
本文介绍了例如阶乘时间算法澳(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆