![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法二
清风_润物细无声
这个作者很懒,什么都没留下…
展开
-
排球队员站位问题(回溯法)
来源:http://blog.csdn.net/niuox/article/deta #include using namespace std; int main() { int positionCan[6][6];/*运动员对于某个位置能不能站,0代表能,1代表能*/ int position[转载 2016-05-05 18:29:57 · 958 阅读 · 0 评论 -
回溯法_TSp
这个代码很乱,没来得及简化, #include #define MAX 1000 #define N 5 using namespace std; int BOUND=100; void main() { int path[N][N]= { {MAX,3,3,2,6}, {3,MAX,7,3,2}, {3,7,MAX,2,5}, {2,3,2,MAX,3}原创 2016-05-16 14:00:04 · 1290 阅读 · 0 评论 -
回溯法_0/1背包问题(非递归)
这个代码并不好!我写这个主要是理清思路。如果要具体明白算法,可以参考《算法设计与分析》181页和《计算机算法设计与分析》138页, #include #include #define n 5 #define M 50 typedef struct { float w; float p; float v; }OBJECT; OBJECT ob[n]; //int x[n原创 2016-05-18 15:20:41 · 2199 阅读 · 1 评论