📄 minspantree.h
字号:
/*#pragma once
#include "Graph.h"
#include "Sqlist.h"
extern const int MaxNumVertices;
extern CSqlist VerticesList;
class MSTEdgeNode
{ //最小生成树边结点的类声明
public:
friend class MinSpanTree;
int tail, head; //两顶点位置
int cost; //边上的权值
};
class MinSpanTree { //最小生成树的类定义
public:
MinSpanTree ( int sz = MaxNumVertices-1 ) : MaxSize (sz), n (0)
{ edgeValue = new MSTEdgeNode[MaxSize]; }
void Inser(MSTEdgeNode & item);
private:
MSTEdgeNode *edgeValue; //用边值数组表示树
int MaxSize, n; //数组的最大元素个数和当前个数
};
void MinSpanTree::Inser(MSTEdgeNode & item)//向生成树边值数组内存放
{
edgeValue[n].tail = item.tail;
edgeValue[n].head = item.head;
edgeValue[n].cost = item.cost;
//cost=cost+dist;
n++;
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -