資源簡介
算法設(shè)計與分析用分支限界法解決最優(yōu)裝載問題,,,
代碼片段和文件信息
#include?
using?namespace?std;
class??MaxHeap;
class??HeapNode;
class?bbnode{
friend?void?AddLiveNode(MaxHeap&bbnode*intboolint);
????friend?int?MaxLoading(int*intintint?*);
private:
bbnode?*parent;????????????//??指向父節(jié)點的指針
bool?Lchild;????????????????//左兒子節(jié)點標志
};
class?HeapNode{
friend?void?AddLiveNode(MaxHeap&bbnode?*intboolint);
friend?int?MaxLoading(int*intintint*);
friend?class?MaxHeap;
public:
private:
????bbnode?*ptr;??????????????????????????????????//指向活節(jié)點在子集樹中相應(yīng)節(jié)點的指針
????int??uweight;????????????????????????????????//??活節(jié)點的優(yōu)先級--上界
????int??level;??????????????????????????????????//????活節(jié)點在子集樹中所處的層序號
};
class??MaxHeap{
friend??void??AddLiveNode(MaxHeap&bbnode?*intboolint);
????friend??int??Maxloading(int*inti
- 上一篇:C語言畫圖板代碼
- 下一篇:USB2.0接口電路設(shè)計與編程
評論
共有 條評論