加载中…
  
博文
标签:

节点

最优值

左子树

utf-8

回溯

杂谈

    使用了不太需要的模板来写,而且,因为没有能够找到能在ISO标准下的g++中实现friend函数的方法,结果只能很无奈地全部public了,叹一个~

bag2.cpp

#include <iostream>
using namespace std;

class Object;

template <class Typew, class Typep>
Typep Knapsack(Typep *p, Typew *w, Typew c, int n);

void MergeSort(Object *, int);

class Object
{
public:
int operator <= (Object a)const
{
return (d >= a.d);
}
int ID;
float d;
};

template <class Typew, class Typep>
class Knap
{
public:
Typep Bound(int);
void Backtrack(int );
Typew c;//weight constrain of the ba
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有