简体   繁体   English

具有O(2 ^ n * n)的背包算法

[英]Knapsack Algorithm with a O(2^n*n)

Which algorithm for the knapsack problem has a O(2^n*n) complexity? 哪种背包问题算法的复杂度为O(2 ^ n * n)?

I've been asked to implement a solution for the knapsack problem. 我被要求为背包问题实施解决方案。

I'm familiar with programming but not with asymptotic notation. 我熟悉编程,但不熟悉渐进符号。

Can anybody advise me on which algorithm has a O(2^n*n) complexity? 谁能告诉我哪种算法的复杂度为O(2 ^ n * n)?

O(n * 2 ^ n)是蛮力算法的性能(=只需尝试所有组合),请参见http://en.wikipedia.org/wiki/Knapsack_problem#Meet-in-the-Middle_Algorithm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM